diff --git a/src/fields/SuperTableField.php b/src/fields/SuperTableField.php index 24ef955..c03c0a3 100644 --- a/src/fields/SuperTableField.php +++ b/src/fields/SuperTableField.php @@ -389,6 +389,9 @@ public function setBlockTypes(array|SuperTableBlockType $blockTypes): void } } + // Add a random value to trigger project config changes, we still need to figure out + $blockType->changedFieldIndicator = rand(); + $fieldLayoutTab->setElements($layoutElements); $this->_blockTypes[] = $blockType; } diff --git a/src/models/SuperTableBlockType.php b/src/models/SuperTableBlockType.php index 5356366..d1f369a 100644 --- a/src/models/SuperTableBlockType.php +++ b/src/models/SuperTableBlockType.php @@ -46,6 +46,11 @@ class SuperTableBlockType extends Model implements GqlInlineFragmentInterface */ public ?string $uid = null; + // Required for some reason to prompt project config that a change has occured when modifying fields + // for Matrix > ST > Matrix. Changes won't apply unless something in the blocktype model has changed, + // so for the moment, we'll use this as a flag to always trigger a save, until we figure it out. + public mixed $changedFieldIndicator = null; + // Public Methods // ========================================================================= @@ -138,6 +143,7 @@ public function getConfig(): array $field = $this->getField(); $config = [ + 'changedFieldIndicator' => $this->changedFieldIndicator, 'field' => $field->uid, 'fields' => [], ];