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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adamsro’s picture

I 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 method getIdFieldInfo that doesn't return the entity properties. entity_get_property_info doesn't return the properties because the hook entity_entity_property_info_alter isn't registered or called when module_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 function search_api_db_update_7104

adamsro’s picture

drunken monkey’s picture

Status: Active » Needs review
FileSize
5.81 KB

Ew, 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!

Status: Needs review » Needs work

The last submitted patch, 3: 2428693-3--invoke_no_hooks_in_update_7104.patch, failed testing.

Status: Needs work » Needs review
drunken monkey’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

The fails seem completely unrelated, so I'm just trying again.
It would be great if you could test that this does work as intended!

  • drunken monkey committed 83235d1 on 7.x-1.x
    Issue #2428693 by drunken monkey, adamsro: Fixed update hook 7104 to not...
drunken monkey’s picture

Status: Needs review » Fixed

Committed.
Thanks again for your help!

adamsro’s picture

Sorry I didn't have a chance. Looks like I'll get to test it next upgrade though. Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.