Support

Account

Home Forums Add-ons Flexible Content Field Duplicated Flexible Content loses original attributes

Solved

Duplicated Flexible Content loses original attributes

  • Hi all,

    I’ve got an small issue when duplicating a flexible content field on the same post type. Basically whenever I click on the “duplicate” option and save the Custom Group, it will ended up creating a duplicated field with some of the original attributes completely lost. There are times when even the selected post type for the field group (under location > rules) is also changed back to “post”.

    It is important to mention that I’ve done this with a complex flexible content field including on its children fields repeaters, selects and other input types. Also I have different settings for some of them like displaying as table, rows, blocks, maximum and minimum attributes, etc. Some of them went back to the default states instead of the selected originally.

    I’m duplicating those flexible content fields on different tabs.

    ACF version: PRO 5.2.9
    WP version : 4.2.4

    Cheers,

    Milton

  • I just tried this and I didn’t have a problem duplicating a field group. Everything seemed to copy as expected.

    Are you using the “Duplicate” that is built into ACF or another duplication method?

    Have you tried it with ACF 5.3.0?

    If you’re still seeing this problem can you attach an export of a field group that you’re seeing the problem with?

  • Hi John,

    Thanks for reply. I did test it with the latest version of WP and the latest version of ACF as for today. I have identified that this is happening when you want to duplicate a flexible content with one or more repeaters inside. Depending on the complexity of the flexible content field and its content, once you update the field group, the resulted duplicated content has some data lost.

    I also noticed that ACF plugin is unable to update the JSON file for the field group and instead it is creating a new one with the new flexible content on it.

    Cheers,

    Milton

  • I just tried duplicating the field group you supplied. I didn’t look at every field, but all the nested repeaters seemed to duplicate properly.

    When you say

    I also noticed that ACF plugin is unable to update the JSON file for the field group and instead it is creating a new one with the new flexible content on it.

    This would be normal. Duplicating a field group is creating a new field group. Once it is duplicated it is separate from the original. Are you expecting that updates to one version of the field group will be copied to the second version?

  • Hi John,

    Thank you for your reply. Probably I didn’t make myself clear and you are misunderstanding the issue. I’m not trying to duplicate a “Field Group”, but I’m trying to do is duplicating a “flexible content” field inside the same field group. My intention is not to create another field group but to just duplicate a field in the same field group. I understand that creating a separate field group will create a separate JSON file, but adding a new field (by duplicating one of the existing) should update the existing one.

    Once again, the issue that I’m reporting is when you duplicate a “field” , specifically a “flexible content” field that contains repeaters. Duplicating the field and saving this field group will create a duplicated field but with some attributes lost.

    Hope this explanation is a bit more clear than the others. Try to duplicate a flexible content field inside the provided field group instead of duplicating the whole field group. In order to see the missing data, you probably will need to go the post type attached to this group field.

    Cheers,

    Milton

  • Yes, that does clear thinks up a bit. I will take a look at this.

    I have one suggestion though without looking too closely though. Usually when fields and field data disappear when saving a field group and other odd things like this it’s because you running up against the limit of the php setting max_input_vars.

    Without duplicating a field your field group has 15,245 fields. I’d say that you’ve already increased max_input_vars before or you couldn’t have saved what you posted. You might want to increase it again. I find this plugin very helpful when developing large complicated fields groups. https://wordpress.org/plugins/wp-max-submit-protect/

    Let me know if that does not solve your problem.

  • Hi John,

    Thanks for that, I didn’t even consider the max_input_vars as part of the problem, but in fact it was. Increasing the limit solved the issue and ACF is now able to “update” the current field group JSON file rather than creating a new one.

    I didn’t realise my field group is that big now. Probably the only thing that makes me think it was something related to the ACF plugin was that I always got a “field group updated” successful message instead of a warning or error and the fact that it creates another JSON file.

    Anyways, thanks for the tip mate.

    Cheers,

    Milton.

  • Just a side note. You may want to test creating a post with content in all of these fields, multiple layouts and multiple repeaters, etc. I have one site with a huge field group like this that times out when the client hits update. If I’d known it was going to happen I would have built it differently. Problem is that every field that’s saved generates a db query. Not saying you’ll have an issue, my field group has a lot of wysiwyg fields, which may also be contributing to the problem.

  • Hi John,

    Thanks for the advice. I totally agree with that. Since we’ve identified that it was required to increase the max_input_vars, we are right know redeveloping the field groups structure for a better approach, creating a couple of more custom post types instead and reducing the amount of fields per group.

    Cheers,

    Milton

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Duplicated Flexible Content loses original attributes’ is closed to new replies.