Skip to content

Commit 442ff13

Browse files
committed
Updated dev provisioning to be more verbose.
1 parent 89b050a commit 442ff13

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

web/modules/custom/civictheme_dev/civictheme_dev.install

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ function civictheme_dev_install(): void {
3535
$executed_updates = $key_value->get('existing_updates', []);
3636
foreach ($executed_updates as $function) {
3737
if (str_starts_with((string) $function, 'civictheme_dev_post_update_')) {
38+
print sprintf('Running post-update function: %s%s', $function, PHP_EOL);
3839
$sandbox = [];
39-
call_user_func($function, $sandbox);
40+
$ret = call_user_func($function, $sandbox);
41+
if (is_string($ret)) {
42+
print $ret . PHP_EOL;
43+
}
4044
}
4145
}
4246
}

web/modules/custom/civictheme_dev/civictheme_dev.post_update.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ function civictheme_dev_post_update_update_side_navigation_block(): string {
9494
throw new UpdateException('Unable to find Side Navigation block.');
9595
}
9696

97-
$block = reset($blocks);
98-
99-
$block->setVisibilityConfig('request_path', [
100-
'id' => 'request_path',
101-
'negate' => TRUE,
102-
'pages' => "/search\n\r/news-and-events\n\r*civictheme-no-sidebar*",
103-
]);
104-
$block->save();
97+
foreach ($blocks as $block) {
98+
$block->setVisibilityConfig('request_path', [
99+
'id' => 'request_path',
100+
'negate' => TRUE,
101+
'pages' => "/search\n\r/news-and-events\n\r*civictheme-no-sidebar*",
102+
]);
103+
$block->save();
104+
}
105105

106106
return 'Updated Side Navigation block visibility settings.';
107107
}

0 commit comments

Comments
 (0)