-
Notifications
You must be signed in to change notification settings - Fork 684
Closed
Labels
Description
Using Craft CMS 3.5.0RC1, the SEOmatic plugin uses ->enabledForSite() which is now deprecated:
return Entry::find()
->section($metaBundle->sourceHandle)
->id($elementId)
->siteId($siteId)
->enabledForSite(true)
->limit(1)
->one();
}The `enabledForSite` element query param has been deprecated. `status()` should be used instead.
...which is fine. But it results in a hard error, rather than a deprecation notice and a mapping to the new intended behavior:
2020-07-23 10:46:41 [-][-][-][error][craft\queue\QueueLogBehavior::afterError] [8823] Generating notFound sitemap (attempt: 1) - Error (time: 0.086s): The `enabledForSite` element query param has been deprecated. `status()` should be used instead.
2020-07-23 10:46:41 [-][-][-][error][craft\errors\DeprecationException] craft\errors\DeprecationException: The `enabledForSite` element query param has been deprecated. `status()` should be used instead. in /home/forge/devmode.fm/releases/35afa05cf9c7234620d6d94438ca93d6dd7b7d0f/vendor/nystudio107/craft-seomatic/src/seoelements/SeoEntry.php:198
Stack trace:
#0 /home/forge/devmode.fm/releases/35afa05cf9c7234620d6d94438ca93d6dd7b7d0f/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1024): craft\services\Deprecator->log('ElementQuery::e...', 'The `enabledFor...')
#1 /home/forge/devmode.fm/releases/35afa05cf9c7234620d6d94438ca93d6dd7b7d0f/vendor/nystudio107/craft-seomatic/src/seoelements/SeoEntry.php(198): craft\elements\db\ElementQuery->enabledForSite(true)
Is this intended? If so, is moving to ->status() backwards compatible?