Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use field collection on a specific content type.
And on hook_node_validate function, I check whether input values are correct or not.
The problem goes like this.
- If I click remove button without saving node form, It works perfectly even though input values are wrong.
- But If I type some wrong values on field collection field, and click save button on node form, hook_node_validate sets errors on the form as expected.
- After that If I click remove button, then the item is not removed and It shows earlier form error that says you have wrong values. I think despite the fact that the values are wrong, remove button should work properly because validation is not required for remove.
Is there anyone facing same problem or solved the issue?
Comments
Comment #1
bradallenfisher CreditAttribution: bradallenfisher commentedYes... I have nested fields and really can't even get the validation to work properly. However, the issue at hand is that the remove button doesn't remove the item(s). These nodes have been saved. Upon re-editing the remove feature just spins the ajax wheel and does nothing.
Comment #2
tim.plunkettI've found many different scenarios that all seem to be incarnations of the same bug. I'm marking this as a duplicate to try and focus efforts.
#1675522: Remove button broken if form is rebuilt (via ajax or failed validation)