- ๐บ๐ธUnited States smustgrave
Tagging for security implications just in case.
Still needs subsystem maintainer review.
- Status changed to Needs work
about 2 years ago 11:02pm 15 February 2023 - ๐บ๐ธUnited States smustgrave
Relooking at the issue summary and the proposed solutions have a number of questions? Do those need to be answered before reviewing? If they've been answered can the issue summary be updated please.
Updated patch to prevent:
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (regel 159 van /app/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php).- ๐บ๐ธUnited States pbabin
I'm in Drupal 10.3.1 using Mercury Editor, Layout Paragraphs and Paragraphs.
We are getting the following error when editing a node with the above setup with a particular paragraph type which is referencing an image (the image is not using a view to render - it is default).
This entity (paragraph: [paragraph id #]) cannot be referenced.
I found initially that I could clone the entity, delete the original, and then save the node. However, on the next edit the issue still remained.
I tried the patch from 39 and could not apply it.
I tried the patch from 38 and it addressed my specific issue.
- ๐บ๐ธUnited States nrogers
Rerolled #38 for 10.3.x branch (it also applies to 11.x). There's something not quite right in #40 it's missing a variable name. I couldn't reproduce the TypeError either. I'll push this to an MR for 11.x as well.
- Merge request !9210Close #2973863: Do not enforce data integrity on pre-existing entity references โ (Open) created by nrogers
- ๐ฌ๐งUnited Kingdom Dubs
There is an additional problem here - if we're working with TRANSLATED entities, the existing entity IDs need to be added from all the translations, otherwise the integrity violation still gets triggered. I've added another patch (apologies - haven't figured out how to contribute to an existing PR yet).
- ๐ฌ๐งUnited Kingdom Dubs
There is an additional problem here - if we're working with TRANSLATED entities, the existing entity IDs need to be added from all the translations, otherwise the integrity violation still gets triggered. I've added another patch (apologies - haven't figured out how to contribute to an existing PR yet).
- ๐ฉ๐ชGermany harkonn
I tested the patch from #45 in drupal 10.4.1 and it works like desired.
Non user-1 users can now successfully save published content that references entities that got unpublished in the lifecycle of the content without needing to unreference these items. - ๐ฉ๐ชGermany harkonn
There was a bug with #45. Adding references to empty fields caused
Warning: Undefined variable $existing_target_ids in Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator->validate() (Line 140 in project\docroot\core\lib\Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator.php)
I fixed this bug by initialising the variable properly and i commited these changes to the issue fork / merge request.
- ๐ฎ๐ณIndia manish-31
Fixed the bug mentioned in #47 from the patch #45 (for 10.4)