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.
When running search_api_db_update_7104() on a Panopoly site, I get the following:
Entity type Indhold doesn't specify a type for the nid property.
This prevents updating of the site.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2428693-3--invoke_no_hooks_in_update_7104.patch | 5.81 KB | drunken monkey |
#2 | entity-type-indhold-doest-specify-a-type-for-the-nid-property-2428693-2.patch | 553 bytes | adamsro |
Comments
Comment #1
adamsro CreditAttribution: adamsro commentedI get a similar error:
Entity type Node doesn't specify a type for the nid property.
The origin of this error seems to come from a call to
entity_get_property_info
in methodgetIdFieldInfo
that doesn't return the entity properties.entity_get_property_info
doesn't return the properties because the hookentity_entity_property_info_alter
isn't registered or called whenmodule_invoke_all('entity_property_info')
is run.I think this is related to system info cache writing and registry rebuilding is broken without a full bootstrap and Running drush updatedb causes an incomplete module implements cache
Kind of a hack, but I was able to get the update to run by adding the line
module_implements('', FALSE, TRUE);
to the beginning of functionsearch_api_db_update_7104
Comment #2
adamsro CreditAttribution: adamsro commentedComment #3
drunken monkeyEw, that's an ugly problem … Thanks for reporting and already providing an analysis and a workaround!
In general, it should absolutely be avoided to invoke any hooks from an update hook – and obviously for good reasons. If we have to do it, then I guess we might as well apply that dirty workaround for this problem and hope it helps. (Although it's curious that this problem only occurs now, even though the code has been there for over a year.)
However, I've thought about it a bit more, and I think we can avoid the call after all. We already have the right
id
column definition in the existing fulltext tables – so if we just work with one of those and alter it instead of creating a new table, this should work as well and avoid this call and all associated problems.Patch attached, please test/review!
Comment #6
drunken monkeyThe fails seem completely unrelated, so I'm just trying again.
It would be great if you could test that this does work as intended!
Comment #8
drunken monkeyCommitted.
Thanks again for your help!
Comment #9
adamsro CreditAttribution: adamsro commentedSorry I didn't have a chance. Looks like I'll get to test it next upgrade though. Thanks for the patch!