I try to copy a group of fields from one wp installation to another. Both systems running with latest WP & ACF Pro.
When I try to import the json file I get the error like “import file empty” (using the german “version”).
Here is the file: http://www.realmaker.de/downloads/acf-export-2015-10-26(2).json
I tried serveral times.
I remeber I had the error before and then added the files manually to the other system. But I need the field keys to be equal this time.
Can somebody help?
I tried the import on another WP installation and it worked! So there must be a problem at the WP System. What can that be?
What other plugins do you have running on the site with the problem? Have you tried deactivating any other plugins?
thanks your your reply!
It seems like the plugins are not the problem. I installed the same on my test system without issues.
Is it possible that there are some right issues when uploading the json file? Do you know to wich directory the json file is uploaded before the import?
the file would be uploaded to whatever the temp folder is on your server/host.
The error that you are getting. After the file is uploaded ACF does a json_decode() on the contents. This returns null if there is something wrong with the json in the file. The only thing I can think of is that the file is somehow being altered during the upload process, maybe something to do with the host.
Try uploading the file to your media library if it will let you and then compare it to the original.
For those who still struggle with this problem: check if your exported JSON file has BOM marker (it depends on the server whether this marker is added to a file). When the marker is present, import doesn’t work. You can always open file in Notepad (on Windows) and save file with UTF-8 coding (not “UTF-8 with BOM”) – it should work unless your file has some syntax issues.
Another potential cause for this issue that I just ran into: open_basedir is in effect and does not include the temporary directory where files are uploaded to by PHP.
ACF reads the files directly, which fails under those circumstances. I’ve filed a bug report, but temporary solution: just change open_basedir to include whatever sys_temp_dir is set to (usually “/tmp” on linux/unix).
So here’s some insight into another part of this glitch.
I’m running a staging site that has the normal wordpress debug=true on it for develelopmental purposes.
Right now i have an error showing up in the header of my wp-admin for some other plugin that has update issues.
But when I do an export of fields from the staging site – to transfer them to the live site – it comes up with an ‘Import file empty.” message.
So when i look at the json file, the debug error that i had on my staging site is at the top of the json file, meaning its messing the whole file up and won’t upload.
This is using the latest ACF Pro version, just FYI.
Weird glitch, but hopefully this helps anyone else out.
All i had to do is remove the text lines from the json file – up til the first ‘[‘ bracket, and then it would upload fine.
You must be logged in to reply to this topic.
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!
© 2020 Advanced Custom Fields. Subscribe