New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeatable custom field inside repeatable group don't save properly #1035
Comments
When I removed HTML from the custom fields it will save the first group correctly, but when adding new group and creating 3 new fields in this second group, it will push the third field into a new group after updating the post (I updated the gist with the change) I thought it worth mentioning that **when looking at inputs IDs and the html for the fields in general, the js is giving wrong group IDs/Names ** , I'm not pretty sure, but I guess the issue goes with the ' I also noticed if you click the "remove field" button on the an empty field (the only field in a group) it will create an empty field in the previous group.
|
I was able to solve this by doing some changes in The solution was based on another fork by @nonsensecreativity nonsensecreativity@a15bf58 There is another issue tough, when trying to remove a field from empty group, it will create new empty field in previous group. hope you can tackle these in the next release. |
If I recall right, CMB2 will visually provide at least 1 field, though it won't, or at least shouldn't, save anything with it visually shown. Only once items start getting filled in would anything save. |
@tw2113 That is correct, I probably didn't explain this clearly. The issue I had is that the JS was not giving IDs/Names correctly which was causing issues when saving the post, similar issues were posted before: I solved this, but I found another issue with I tried changing So I ended up changing this
|
@jtsternberg You have any ideas here? |
Thank @bomsn, I got the same issue. Your patch worked for me. |
@Mr2P Make sure to use the patch on the trunk version. If it still doesn't work please share the code for rendering you custom field. Also does it work correctly on the 3 first groups, or you get the same issue on all groups? |
@bomsn Your patch solved my issue. I only needed the group index is correct for my hotfix. |
@Mr2P Happy it helped. |
I created custom field based on the address field
Expected Behavior:
Actual Behavior:
Steps to reproduce (I have confirmed I can reproduce this issue on the trunk branch):
I suspect it's javascript bug.
CMB2 Field Registration Code:
https://gist.github.com/bomsn/36174de42bfbaa74abcd5bce1bfc432d
The text was updated successfully, but these errors were encountered: