backdrop-contrib / entity_plus

This module wraps in a variety of additional entity-related functionality from various sources. Partial port of D7 Entity API.
https://backdropcms.org/project/entity_plus
GNU General Public License v2.0
3 stars 11 forks source link

Use of undefined constant ENTITY_CUSTOM? on update. #115

Closed diannevolek closed 2 years ago

diannevolek commented 2 years ago

When I tried to do this update, I received the following messages just before the database updates and I can't go further.

Warning: Use of undefined constant ENTITY_CUSTOM - assumed 'ENTITY_CUSTOM' (this will throw an Error in a future version of PHP) in search_api_index_load_multiple() (line 2841 of /home/cbibreakers/public_html/modules/contrib/search_api/search_api.module).

Warning: Use of undefined constant ENTITY_CUSTOM - assumed 'ENTITY_CUSTOM' (this will throw an Error in a future version of PHP) in EntityPlusController->load() (line 286 of /home/cbibreakers/public_html/modules/contrib/entity_plus/includes/entity_plus.controller.inc).

Does this module impact on Search? Or is this just a co-incidence.

(I updated Core, and then Entity Reference just before this. Perhaps they should have been done together?)

argiepiano commented 2 years ago

Hello @diannevolek . Thanks for reporting.

This is an issue with the Search API module. Entity Plus recently changed its constants to start with ENTITY_PLUS_XXX to avoid collisions with other modules. It looks like the maintainers did not make that change in Search API.

I will open an issue there, since this will affect other people too.

argiepiano commented 2 years ago

@diannevolek , as a temporary workaround, go ahead and install Entity UI. That module defines those same constants without the "PLUS" identifier. That way Search API will be able to find those constants.

argiepiano commented 2 years ago

Closing as this issue is caused by Search API

robertgarrigos commented 2 years ago

Not exactly. This error is caused by not having Entity UI module enabled, which is the module who defines that constant. And there are many other modules which use that constant.

But yes, Search API could fix this by adding a dependency on Entity UI.

argiepiano commented 2 years ago

Thanks @robertgarrigos. Actually, it's more complex than that. Entity Plus used to define those constants, but the names were changed last year to avoid a conflict with Entity UI (Entity Plus and Entity UI were part of a single D7 module, Entity API. Entity API was ported to Backdrop in bits and pieces, and Entity Plus and Entity UI were split. Both ended up defining the same constants).

So, it would be easier (and make more sense) for Search API to use the newly-named Entity Plus constants, rather than depending on Entity UI, which it simply doesn't need.