- 🇺🇸United States attheshow
Just reporting that I ran into the same issue here with a custom entity.
- Status changed to Needs review
about 1 year ago 11:31am 13 October 2023 - last update
about 1 year ago 32 pass - 🇭🇺Hungary imre.horjan Hungary
Hello,
f you don't mind I reopen this issue and added a patch for it.
I can reproduce it using Drupal 10.1, PHP 8.1, while editing a menu item using the Group Content Menu module.
https://www.drupal.org/project/group_content_menu/ →Even though simple sitemap is enabled only for node and media entities, I get the same error message editing an entity (menu item in this case).
I think custom entity types can also trigger this error, which prevent editing them. - last update
about 1 year ago 32 pass - First commit to issue fork.
- 🇫🇮Finland ZeiP
We were also experiencing this after D10.1 upgrade. For us it seems to be caused and fixed by 🐛 Operation is null in custom menu link form Needs review . The patch also did fix it though.
- Status changed to Closed: works as designed
about 1 year ago 4:12pm 17 October 2023 - 🇷🇺Russia walkingdexter
The patch is not needed. If
$form_object->getOperation()
returnsNULL
it means that theEntityFormInterface
is not implemented correctly. - Status changed to RTBC
4 months ago 7:42pm 21 August 2024 - 🇺🇸United States jnicola
This fixes the same error for me that I experience when deleting group_content_menu items.
I don't think it would be criminal to consider making the code here a bit more tolerant, especially since in it's tolerance everything is hunky dory.
- Status changed to Closed: works as designed
3 months ago 4:28pm 11 September 2024 - 🇺🇸United States jnicola
@walkingdexter could you explain your resistance or what the issue would be in implementing this bit of code?
I don't think it's fair to say that getOperation() returning NULL is a third party problem, since getOperation does not specify return types.
- 🇷🇺Russia walkingdexter
I don't think it's fair to say that getOperation() returning NULL is a third party problem, since getOperation does not specify return types.
@jnicola The return type is specified in PHPDoc, which is respected by PHPStan.
- 🇺🇸United States jnicola
Eh, I suppose. I wonder just how much of Drupal would need to be redocumented or fixed once return types are specified and discover how much wasn't actually as expected...
Is there any loss to be had adding a sanity check here besides a milisecond or two of time?
- 🇷🇺Russia walkingdexter
Is there any loss to be had adding a sanity check here besides a milisecond or two of time?
I'm not a fan of adding unnecessary checks that go against the documentation. Incorrect implementation can lead to errors not only with this module. The above case clearly shows that the problem is related to the third party.
- 🇩🇪Germany gbyte Berlin
I support walkingdexter on this matter - I do sometimes work around other modules' problems, but those modules better be in core, otherwise this is a never ending endeavour.