Skip to content

Commit

Permalink
fix: Better fix for an issue where SEOmatic would cause other plugins…
Browse files Browse the repository at this point in the history
… to fail to be able to register Twig extensions after it when using the CLI command `craft plugin/install --all` ([#1312](#1312))
  • Loading branch information
khalwat committed May 4, 2023
1 parent a62c975 commit a55e0b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/models/MetaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace nystudio107\seomatic\models;

use Craft;
use craft\behaviors\EnvAttributeParserBehavior;
use craft\helpers\Json as JsonHelper;
use craft\validators\ArrayValidator;
Expand Down Expand Up @@ -185,6 +186,10 @@ public function normalizeMetaBundleData(bool $parse = true)
if ($this->frontendTemplatesContainer !== null && is_array($this->frontendTemplatesContainer)) {
$this->frontendTemplatesContainer = FrontendTemplateContainer::create($this->frontendTemplatesContainer);
}
// If Craft hasn't been initialized yet, don't parse the bundle
if (Craft::$app->getIsInitialized()) {
$parse = false;
}
// Create our variable so that meta containers can be parsed based on dynamic values
// Make sure Twig is loaded and instantiated first by priming the pump
if ($parse) {
Expand Down

0 comments on commit a55e0b1

Please sign in to comment.