Home › Forums › General Issues › No fields generated from exported php code
The php export file has completely stopped working for me with ACF 4.3.0.
I have a development site where I create the fields with ACF and then I export to the php file and use ACF LITE mode on the main site.
No fields are created and getting the fields doesn’t work either.
No errors show up. I had updated WP to 3.7.1, but with the issues I reverted back and am now on 3.6.1 and ACF 4.2.2, but when I update to 4.3.0 it breaks.
I updated it with version control, do you think I need to deactivate and reactivate the plugin?
I just deactivated all plugins and reactivated them and that didn’t help.
Hi @adamholte
Can you please describe the issue with more detail?
What does ‘but when I update to 4.3.0 it breaks’ mean?
The clearer I can visualize the issue, the easier I can replicate it and find a solution
Thanks
E
I meant to post a bug report on this but forgot. I can’t remember which field it is, but one type doesn’t get a closing bracket for the translation function {__()}.
Copy and paste the php output into an IDE like netbeans and you’ll see the error lines.
(away from computer right now or I’d do it myself)
@squarestarmedia, that’s a different bug that I also experienced (http://support.advancedcustomfields.com/forums/topic/export-fields-acf-4-3-0/), but that’s not what I’m experiencing here.
I have a development site where I create all my fields with the ACF user interface. The easiest way to make sure my live site and my development site are using the same fields is with the php export.
I have ACF installed as a normal plugin on both sites. On my live site I define ACF_LITE to true, then in a custom plugin, I check to see if ACF_LITE is true and I include a php file with the code from the php export.
In version 4.2.2 everything worked great. When I upgrade, it completely breaks, and by that I mean, I see NO fields in the admin section, and none of the fields are returned on the front end. When I revert back to 4.2.2 everything works fine again.
When I first attempted the upgrade, I also upgraded WordPress, so I reverted back to wordpress 3.6.1 and ACF 4.2.2. Since then I’ve upgraded wordpress and kept ACF the same, so I’m experiencing the same functionality on WP 3.6.1 and 3.7.1.
I’m having the same issue. All the fields I’m loading via register_field_group
have suddenly disappeared.
@adamholte,@chris,
That explains something, as I just started experimenting with a theme-included setup yesterday and couldn’t figure out why I wasn’t seeing any fields. I thought I was doing something wrong, but it seems I was just experiencing the same issue as you guys.
Hi guys
Can you confirm if you are including ACF in your theme, or are you activating it as a normal plugin?
Thanks
E
Having exactly the same issue as well, everything is set up correctly and was working before the update, ACF plugin is not included in a theme.
Hi guys
You may be experiencing the same issue as:
http://support.advancedcustomfields.com/forums/topic/fatal-error-4-3-0-acf_field-not-found/
Thanks
E
I am including register_field_group in a plugin and that link looks like you were focusing on them being included in themes. I am just including register_field_group right in the plugin, should I be using a specific hook to call it instead?
Hi @adamholte
Sorry, just to clarify. Is the issue that the ACF plugin is NOT exporting any field data from the export page?
Thanks
E
No, sorry, that’s not the problem, the code is generated, but the fields I add with register_field_group never show up (either front or back-end). I was responding to your link. The issue in that link looked like it was when register_field_group was included in a theme file, I was just saying that I call register_field_group in a plugin.
I’ll try to test the most updated code from git-hub today if I get a chance.
I’m not loading the plugin from within a theme either; it’s being loaded as a standard plugin (not ACF lite).
Hi guys
Can you confirm there is no syntax issues in teh exported code. 4.3.0 introduced a __() wrap around labels and instructions. This has caused some issues with strings that contain quote marks and has been removed.
Perhaps this could lead to a solution?
Thanks
E
I know that’s not the issue I’m experiencing. Mine fails on code generated by 4.2.2. That issue, which I also experienced, completely broke my site because of the invalid php syntax.
I just tested the most recent version from github and that seems to work fine for me.
I tested calling register_field_group
in both a fuction called on the init hook, and right in a plugin file and they both seem to work fine. I think I’ll keep it in the init hook unless that’s a bad idea of some reason.
It might reduce problems down the line if you create a specific hook that people can use to call register_field_group
kind of like the posts to posts plugin does for their p2p_register_connection_type
and the p2p_init
hook. You could wrap the exported code in a function and include the hook right there so people wouldn’t have to do it themselves.
Export PHP doesn’t work. I copied the code into functions.php and nothing happens. I tried deactivating and activating, and no new fields were generated.
The topic ‘No fields generated from exported php code’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.