Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with return format when free ACF installed #296

Open
daprela opened this issue Jan 27, 2016 · 4 comments
Open

Problem with return format when free ACF installed #296

daprela opened this issue Jan 27, 2016 · 4 comments

Comments

@daprela
Copy link
Contributor

daprela commented Jan 27, 2016

Please read this support issue.
http://support.inboundnow.com/support/topic/templates-do-not-work-with-acf-images-as-url-or-object

I've run a test with the free ACF, and this is what I get for the image:

array (
    'key' => 'field_56a866e0b4c71',
    'label' => 'Image',
    'name' => 'image',
    'type' => 'image',
    'save_format' => 'url',
    'preview_size' => 'thumbnail',
    'library' => 'all',
),

the problem is that here
https://github.com/inboundnow/landing-pages/blob/master/classes/class.acf-integration.phpL425
the function look for a 'return_format' key which does not exists

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@atwellpub
Copy link
Member

ACF4 does not handle return formats that I knew of. ACF5(pro) does. Landing Pages automatically accounts for this when it detects ACF4 is installed and activated by turning the media ID into a URL on the value side automatically.

See:
https://github.com/inboundnow/landing-pages/blob/master/classes/class.acf-integration.php#L425-L442

I didn't know ACF4 had a save_format. What do you think we should do?

BTW it looks like his issue was solved by turning the return formatting param to 'true' in get_field. having it set to false disables return formatting. We do this on ACF4 templates because the return format behavior was inconsistent with ACF5 behavior. We had to be prepared for a client to be using either.

@daprela
Copy link
Contributor Author

daprela commented Jan 28, 2016

It is my opinion that the function that you linked doesn't work because in the free ACF version there isn't any 'return_format' key, therefore the two conditions are always false.
If you replace the 'return_format' key with 'save_format' it should work.

The old version of ACF probably used the key save_format that was replaced with a more logical return_format in version 5 but they have the same meaning and scope

@atwellpub
Copy link
Member

Since our design standard ignores save_format should we not worry about it? Honestly I'm not sure atm how to use this information to improve the system.

Eventually, ACF4 will phase out completely via Elliot Colden's words and be replaced with ACF5 as free.

But hey he might not. Anyway taking tips.

@daprela
Copy link
Contributor Author

daprela commented Jan 28, 2016

In my opinion simply replacing the key 'return_format' with 'save_format' in that function should do the trick. At the moment I don't have an inbound installation with the free ACF. As soon as I have time I'll make one and test if my assumption is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants