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.
See #3001919: Cannot delete SavedSearch entity due to pathauto.
The problem: In the Search API Saved Searches module we have a path
field which just saves the path on which the search was originally executed. It has no relation to the Core Path, or to the Pathauto module. However, when deleting a saved search, pathauto_entity_delete()
just assumes that the path
field, if present, always belongs to this module – leading to a fatal error if it doesn’t.
Comment | File | Size | Author |
---|---|---|---|
#9 | 3006420-9.patch | 757 bytes | shubham.prakash |
| |||
#6 | 3006420_6.patch | 680 bytes | StryKaizer |
|
Comments
Comment #2
drunken monkeyEasily fixed by some defensive coding.
Comment #4
StryKaizerComment #5
BerdirThat seems to be a really complicated way to fall back to field definition? Why not do something like $entity->getFieldDefinition('path')->getType() == 'path') after the hasField('path') in the above condition?
Comment #6
StryKaizerHah, you're right. That works too :). Thanks!
Patch attached
Comment #7
BerdirThanks, but I think we should then also not call the delete alias method, so as I wrote, I'd put that condition on the existing if condition, or at least move the delete call inside as well.
Comment #8
shubham.prakash CreditAttribution: shubham.prakash at OpenSense Labs commentedComment #9
shubham.prakash CreditAttribution: shubham.prakash at OpenSense Labs commentedThis patch should fix the issue.
Comment #10
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedLooks good.
Comment #12
BerdirCommitted.