Dear ACF users.

The support forum will be temporarily closed from Friday 24th May until Wednesday 29th May. Over this period, I will be taking some time away from work(ish) and focusing on producing better documentation!

Please use the search forms below (and google) to find documentation and previous discussions. There are loads of useful articles which I'm sure will help you out!

I apologize for the inconvenience. Thanks, Elliot
Current status: Solved. . Done
can't export XML since upgrade to 3.5.0
  • Hi Elliot,

    I upgraded to 3.5.0 earlier today, and went to try to export a few field groups. The PHP export seems to be working fine, but the XML export is failing. I turned on logging, and this is what it's saying:


    Fatal error: require_once() [function.require]: Failed opening required '/wp-admin/admin.php' (include_path='.:/usr/local/Cellar/php/5.3.10/lib/php') in /Users/aaron/code/my-project-folder/wp-content/plugins/advanced-custom-fields/core/actions/export.php on line 20


    Any idea what might be going on?

    Thanks,
    Aaron
  • Getting the same problem here. If I replace the import lines with the old lines from version 3.4.3 it seems to work, but then gets stuck on the "No ACF fields selected" error
  • Hey guys,

    Thanks for the report. I'll look into it.
    Perhaps something is going wrong with posting the absolute path url...

    Cheers
    Elliot
  • Hey guys,

    I can't replicate the issue so I can only assume it's something to do with your server setup.
    Is your folder structure different from the normal?

    It's strange that the error is on line 20, not 19. This demonstrates that the include path is working... but for some reason, that wp-admin/admin.php file does not exist...
  • On further investigation, I think this is an error with ACF.

    Looking at the posted acf_abspath value, I can see that the url for the seccond require (line 20), will have 2 forward slashes instead of 1.

    Can you edit the export.php file and replace the first part with this:
    // vars
    $defaults = array(
    'acf_abspath' => '../../../../../',
    'acf_posts' => array()
    );
    $options = array_merge( $defaults, $_POST );
     
    require_once( $options['acf_abspath'] . 'wp-load.php');
    require_once( $options['acf_abspath'] . 'wp-admin/admin.php');
  • @ajsnow @rosswil - Patch submitted above
  • Hi Elliot,

    The good news I've figured out the problem; the bad news is the patch above does not work.

    The problem is that something in wp-load.php is overwriting your $options var. I checked its contents before and after, and they're totally different.

    The following code works: first do the require_once calls, then load your $options var:
    require_once( '../../../../../wp-load.php');
    require_once( '../../../../../wp-admin/admin.php' );
     
    // vars
    $defaults = array(
    'acf_abspath' => '../../../../../',
    'acf_posts' => array()
    );
    $options = array_merge( $defaults, $_POST );
  • Unfortunately, the import also seems not to have worked entirely correctly. I don't know whether this is related to the issue above.

    I imported two field groups. One looks fine, but the other generates an error whenever I go to edit it; here's the error:


    Fatal error: Call to a member function create_options() on a non-object in /home2/smmoadev/public_html/wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 182


    I'm attaching a copy of the import file that was generated, with the extension changed from .xml to .txt (since .xml is not allowed by the comment board's uploader).

    Any idea what this might be?

    Thanks ...
    Aaron
    advanced-custom-field-export-copy.txt
    14K
  • Ok, I see this meta_box_fields.php bug is specific to me -- I have an apostrophe in an ACF "select" field and it's causing issues. I'll post separately about that another time. Thanks ...
  • Hi @ajsnow

    Thanks, I'll update the options variable name!
  • Hello

    I'm trying to export / import acfs

    Using 3.5.0 - I can export without any apparent errors but some field groups will open but not show any of their content when imported.

    Using 3.5.1 - I can export as 3.5.0 but when I try to open the field group that wouldn't show under 3.5.0 I get the following:
    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/brightsc/public_html/wp-content/plugins/advanced-custom-fields/acf.php on line 658

    Using 3.5.1 beta2 I get the same result as under beta 1

    Do you know what the problem is? Is there a fix?

    Thank you.
  • Hi @gauk

    Can you attach your exported file for me to test with?

    Thanks