backdrop-contrib / metatag

Add structured metadata, aka "meta tags", for various pages on your site.
GNU General Public License v2.0
3 stars 15 forks source link

The script tried to execute a method or access a property of an incomplete object #102

Closed laryn closed 1 year ago

laryn commented 1 year ago

I'm seeing this when submitting the admin/config/search/search_api/index/default_node_index/workflow page (the "Filters" tab on a Solr Index using Search API and Search API Solr) but I think it may be an issue in Metatag with the MetatagSearchAlterCallback class.

Fatal error: search_api_admin_index_workflow_submit(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "MetatagSearchAlterCallback" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition in /app/modules/contrib/search_api/search_api.admin.inc on line 1750

laryn commented 1 year ago

If I add this to metatag_autoload_info then submission works as expected:

'MetatagSearchAlterCallback' => 'metatag.search_api.inc',
quicksketch commented 1 year ago

Thanks @laryn! Fixed in https://github.com/backdrop-contrib/metatag/pull/105.