- Issue created by @abramm
- Merge request !10Issue #3405137: Missing $display check in entity_extra_field_form_alter (edge case) → (Open) created by abramm
- Issue was unassigned.
- Status changed to Needs review
12 months ago 8:41am 30 November 2023 - 🇺🇦Ukraine abramm Lutsk
Here's the MR fixing this issue (and patch if anyone wants to apply it).
- 🇩🇪Germany luenemann Südbaden, Germany
It's also possible to just change the Signature of
entity_extra_field_display
to allow for null. The method can handle that.function entity_extra_field_display( string $type, array &$build, EntityInterface $entity, ?EntityDisplayInterface $display ): void {
- First commit to issue fork.
- Status changed to Needs work
3 months ago 9:05am 13 August 2024 - 🇩🇪Germany Anybody Porta Westfalica
@luenemann where is your code from #4 from?
The current code in 2.0.x is:
/** * Entity extra field display. * * @param string $type * The display type, (e.g. view, form). * @param array $build * An array of elements to attach the extra field. * @param \Drupal\Core\Entity\EntityInterface $entity * An entity instance. * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display * An entity display instance. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginException */ function entity_extra_field_display( string $type, array &$build, EntityInterface $entity, EntityDisplayInterface $display ): void {
So maybe that should be changed instead?
- 🇩🇪Germany Grevil
2.1.x is the latest branch. Let's target the MR on 2.1.x. Also, which MR is the preferable? Let's hide the other one.
- 🇩🇪Germany luenemann Südbaden, Germany
@Anybody the code in #4 is my suggested change. Thank you for turning it into a MR.
@grevil I am not sure which change is preferable.
By looking at this again I thinks MR !24 won't work. If there are extra_fields for that entity bundle it will probably fail.
I am going to hide MR !24.
Still Needs work for target change on MR !10 to 2.1.x (@abramm)
- 🇩🇪Germany luenemann Südbaden, Germany
luenemann → changed the visibility of the branch 3405137-missing-display-check to hidden.
- 🇩🇪Germany luenemann Südbaden, Germany
luenemann → changed the visibility of the branch 3405137-missing-display-check to active.
- 🇩🇪Germany luenemann Südbaden, Germany
luenemann → changed the visibility of the branch 3405137-make-parameter-optional to hidden.