Home › Forums › Backend Issues (wp-admin) › Repeater field with WPML and XLIFF import
I’m having a big issue with my repeater fields and importing translated XLIFF files into WPML. In the XLIFF file, all of the repeater rows are in there, there are 4 of them. When I imported it, and went to the page in the imported language, the page took forever to load. When it finally did, there were 1406 repeater rows, when there should only be 4. The only relation that I see to 1406, is for one of the post IDs that is saved as the value for the repeater field.
I have imported 2 other pages and it has happened on all of them. I have to import a lot more. How can I resolve this issue?
After a little more investigation, I found that the value for the repeater field (number of rows) is not being imported and saved correctly. It is correct in the XLIFF file, but once saved it is using another value.
After even more investigation, when XLIFFs are imported items are saving to the incorrect fields in the DB, however they are correct in the XLIFFs.
Some more information, after the XLIFF is imported using WPML, I checked to make sure everything was correct, it was. Once I saved it, it doesn’t put the correct data in the field. This could be an issue on the WPML side with how it’s saving the data, but I figured I would come here first. I’ll be posting on their forum as well.
I’m not going to say this is you’re problem, but I’ve had similar problems with import tools and WordPress in the past, data being imported to the wrong places. I discovered after a lot of head to keyboard banging that it had nothing to do with WordPress or the import to but with my host. They have XCache installed http://xcache.lighttpd.net/ and I had to disable this before I could do any importing into WP of any kind.
Does your hosting environment have any type of opcode caching running on the server?
I talked to my host and they had opcode caching running. I had them turn it off, tried the XLIFF import again, and still got the same results. This seems to be on the plugin end of ACF or WPML, and the saving of the fields into the DB.
Is the import tool you’re using something that’s built into WPML or is it another tool that you’re using?
The importer is part of WPML. I have reached out to them as well, and I’m waiting to hear back. I feel that it has to do with how they are adding the post meta data. The problem is, they already told me, which I knew they would, that ACF is not a supported plugin. However ACF says it is on their side. I just need to figure this out, because I have a lot of pages to import, so any help or ideas are greatly appreciated!
The problem is not so much whether the operation of ACF will work with WPML really, though I’ve not tried it. The main issue is that the WPML import is not adding the content correctly for ACF. If they are not supporting ACF fields than it’s unlikely that you’ll get this corrected.
I would suggest trying an import plugin that does support ACF, but I don’t remember if it supports WPML… I think it does. You could ask them. http://www.wpallimport.com/
Well they say that ACF is not compatible with with their plugin, however ACF has a page showing how to get it working. It seems that they have some support because all the fields are exported in the XLIFF file from their plugin. The meta fields are also created when the import happens, but the wrong data is put in. I agree this is more of an import issue. I posted in both forums hoping someone would have experienced the same issue. I can’t be the only one having this issue.
The plugin you liked to does not look like it supports XLIFF files. Thanks though.
I tried looking to see if WPML had any filters that would allow modifying the import in any way, but found nothing.
I thought that XLIFF was just a form on XML so I thought it might work.
Just out of curiosity, can you attach the file for a single post export. It might shed some light on the problem.
Opps, clicked too fast, can that be unmarked as the solution? Sorry about that! I attached two different XLIFF files. It is basically an XML file, but structured in a specific way.
I can’t un-mark it as the solution. For some reason your attachments aren’t working either. They just link me back to this post, not sure what’s up with that.
The file type is not permitted. maybe if you put them in a .zip file.
Lets try the upload again, made it a zip.
I’m not familiar with the import but it doesn’t look too complicated from looking at one of those files.
In your first post you said that it inserted 1406 for the number of repeater rows. The two items involved would be
<trans-unit resname="field-subpages-0" restype="string" datatype="html" id="field-subpages-0"> <source><![CDATA]></source> <target><![CDATA]></target> </trans-unit>
<trans-unit resname="field-subpages_3_subpage-0" restype="string" datatype="html" id="field-subpages_3_subpage-0"> <source><![CDATA]></source> <target><![CDATA]></target> </trans-unit>
The second one is the last row to be inserted. The only reason that I can see that this would happen is that the import is ignoring everything after
field-subpages on the row content.
Honestly, I don’t see why they say the import is not compatible with ACF, if all the content is inserted into the fields it’s supposed to be inserted into there should be no reason why it wouldn’t work. What if you just had custom fields with the same names? Example, if you created a field named
my_test_field and another field named
my_test_field_0_xxxx not using acf would it confuse those field names as well?
I totally agree with you, I don’t see why it would not be importing correctly. It exports correctly with the correct fields. They aren’t being too responsive now, so I’m going to dive into their code and do some debugging to see if i can figure anything out. Not what I want to be doing, but I have to get it working.
I’m going to do some test with the XLIFF files as well and remove some information and import them in, and see what happens. I will give your test a go as well, and report back. I really appreciate your help with this. I know this is really not a ACF problem.
I would probably be doing the same thing that you’re doing, digging through code.
I did some looking and I’m finding the information on imports for WPML quite confusing. In some places it says that the posts in the different languages is stored in alternate posts and in other places it says that the information is stored in a separate WPML language table.
The import plugin I mentioned I believe stopped supporting WPML to be honest. But I changed the name of the file you attached to .xml and I was able to upload the file and it understood it, but getting it to work would probably be another story. I’m still a little confused about why it imports the wrong data.
Sorry I couldn’t help more.
Yeah, makes no sense at all why it shows the right data on their edit screen, but doesn’t save it correctly. I appreciate all your help and suggestions!
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.