Skip to content
Snippets Groups Projects
Commit 113b8526 authored by Alex Skrypnyk's avatar Alex Skrypnyk Committed by Deployer Robot
Browse files

Issue #3457993 by alex.skrypnyk: Provisioning script does not re-use existing block UUIDs'.

parent a0aefb9a
No related branches found
No related tags found
No related merge requests found
{"generatedAt":1719625557709,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"javascript","storybookPackages":{"@storybook/addons":{"version":"6.5.16"},"@storybook/html":{"version":"6.5.16"},"@storybook/preset-scss":{"version":"1.0.3"}},"framework":{"name":"html"},"addons":{"@storybook/addon-knobs":{"version":"6.4.0"},"@storybook/addon-essentials":{"options":{"controls":false,"docs":false,"actions":false},"version":"6.5.16"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"}}}
{"generatedAt":1719645440608,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"javascript","storybookPackages":{"@storybook/addons":{"version":"6.5.16"},"@storybook/html":{"version":"6.5.16"},"@storybook/preset-scss":{"version":"1.0.3"}},"framework":{"name":"html"},"addons":{"@storybook/addon-knobs":{"version":"6.4.0"},"@storybook/addon-essentials":{"options":{"controls":false,"docs":false,"actions":false},"version":"6.5.16"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"}}}
......@@ -200,6 +200,8 @@ function civictheme_provision(array $types = [], $clear_cache = TRUE, bool $verb
$types = array_keys($callbacks);
}
// Run callbacks in the order they are expected to be called and filter by
// the provided types.
foreach (array_keys($callbacks) as $callback_type) {
if (in_array($callback_type, $types)) {
if ($verbose) {
......@@ -245,8 +247,25 @@ function civictheme_provision(array $types = [], $clear_cache = TRUE, bool $verb
*
* This will exit with a non-zero code if there was at least one provisioning
* failure.
*
* @param array $include_types
* Optional array of types to include in provisioning. If not provided - all
* types will be provisioned.
* @param array $exclude_types
* Optional array of types to exclude from provisioning. If not provided - no
* types will be excluded.
*/
function civictheme_provision_cli(array $types = []): void {
function civictheme_provision_cli(array $include_types = [], array $exclude_types = []): void {
$types = civictheme_provision_get_types();
if (!empty($include_types)) {
$types = array_intersect($types, $include_types);
}
if (!empty($exclude_types)) {
$types = array_diff($types, $exclude_types);
}
$results = civictheme_provision($types, TRUE, TRUE);
$errors = array_filter($results, static function ($value): bool {
return $value !== TRUE;
......@@ -449,6 +468,7 @@ function civictheme_provision_place_block(string $label, string $region, string
// Remove block if it already exists.
$block = Block::load($values['id']);
if ($block !== NULL) {
$values['uuid'] = $block->uuid();
$block->delete();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment