- Issue created by @s_leu
- Status changed to Needs review
over 1 year ago 10:59am 13 September 2023 - last update
over 1 year ago Patch Failed to Apply Here a basic patch to illustrate the idea of how to change this. The added code should probably be moved into a base class if this approach makes sense at all.
- Status changed to Needs work
over 1 year ago 2:26pm 13 September 2023 - ๐บ๐ธUnited States smustgrave
Thank you for reporting.
Wonder if we could get a test-only patch showing the issue.
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Akhil Babu โ made their first commit to this issueโs fork.
- Merge request !6162Issue #3356684 by sumit_saini, acbramley, smustgrave: Generic Revision UI's... โ (Open) created by Akhil Babu
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Akhil Babu โ changed the visibility of the branch 3387013-check-of-value-11 to hidden.
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Akhil Babu โ changed the visibility of the branch 3387013-check-of-value to hidden.
- ๐ฎ๐ณIndia Akhil Babu Chengannur
I was able to recreate this issue, but only with the help of custom code.
- Go to admin/config/development/logging, select 'All' and save.
- Add a link field with Unlimited cardinality to article content type.
- Create a new article, add one link and save
- Add a form after to article edit form
- Load the node and call validate() method.[$entity = $form_state->getFormObject()->getEntity(); $entity->validate();]
- Now try to edit the previously created node.
The errors appear only when validate() is called on node object when we are in the node edit form. For example
/** * Implements hook_preprocess_HOOK() for page.html.twig. */ function MY_MODULE_preprocess_page($variables) { \Drupal::entityTypeManager()->getStorage('node')->load(1)->validate(); }
will not trigger any errors when the node is viewd. But will trigger error when edit form is loaded.
When the edit form is loaded after adding a link item to an unlimited cardinality link field, Drupal automatically appends a new link widget below the existing one to add a second link item. Somehow, this second item is also validated when the node is validated from the edit form, and this triggers the NULL warning. This won't happen when the node is loaded from any place other than the node edit form. So, maybe the logic in the validate() method needs to be fixed.
I have created a test to show the bug.
- Status changed to Needs review
11 months ago 7:48am 15 January 2024 - Status changed to Needs work
11 months ago 8:27am 15 January 2024 The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.