Skip to content

Commit

Permalink
Merge branch 'craft-5' of https://github.com/verbb/super-table into c…
Browse files Browse the repository at this point in the history
…raft-5
  • Loading branch information
engram-design committed Apr 2, 2024
2 parents d57f407 + d4a75f2 commit 92e3bb7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fields/SuperTableField.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public static function icon(): string
return '@verbb/supertable/icon-mask.svg';
}

/**
* @var string Content table name
* @deprecated in 4.0.0
*/
public string $contentTable = '';

// Public Methods
// =========================================================================
Expand All @@ -42,6 +47,10 @@ public function __construct($config = [])
$config['maxEntries'] = ArrayHelper::remove($config, 'maxRows');
}

// We need to keep the contentTable value around, as it's needed for the v4 (Craft 5) upgrade.
// (Explicitly set it here because Matrix::__construct() just unsets it.)
$this->contentTable = ArrayHelper::remove($config, 'contentTable') ?? '';

parent::__construct($config);
}

Expand Down
6 changes: 6 additions & 0 deletions src/migrations/m240115_000000_craft5.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ public function safeUp(): bool

$fieldsService->refreshFields();

// remove the old Super Table block type configs
$muteEvents = $projectConfig->muteEvents;
$projectConfig->muteEvents = true;
$projectConfig->remove('superTableBlockTypes');
$projectConfig->muteEvents = $muteEvents;

return true;
}

Expand Down

0 comments on commit 92e3bb7

Please # to comment.