Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When working on #3066987: Move Autoprefixer browsers gulp-option to .browserslistrc file i encountred the issue that the existing update hooks run for every child theme instead of the one given as argument to the drush command bs-theme-update [target-machine-name].
In the above mentioned issue I already started to pass the argument:
@@ -745,7 +746,7 @@ function _bs_base_theme_run_update_hooks($target_machine_name) {
$update_function = $theme_name . '_bs_update_' . $version;
if (function_exists($update_function)) {
drush_print($version . ' - ' . strip_tags($description), 2);
- $update_function();
+ $update_function($target_machine_name);
}
}
Now this should be back ported to the last two update hooks, which I do here.
This patch here needs the patch from the mentioned issue applied to work properly!
Comment | File | Size | Author |
---|---|---|---|
#6 | 3067574-ensure_target_theme_in_update_hooks-6.patch | 2.41 KB | pivica |
#6 | interdiff-4-6.txt | 2.59 KB | pivica |
Comments
Comment #2
ytsurkHere we go.
Comment #3
ytsurkComment #4
ytsurkRemoved the loops and added an example function.
Comment #5
pivica CreditAttribution: pivica at MD Systems GmbH commentedI encountered this one also but didn't had time to investigate it. This totally makes sense but we are changing update API a bit with this. Will check this with @berdir to get his opinion on this.
Comment #6
pivica CreditAttribution: pivica at MD Systems GmbH commented@berdir agrees. Updated a patch a bit, nothing special, some empty space removed, improved comments a bit and expanded example. Note that i also updated a patch in #3066987: Move Autoprefixer browsers gulp-option to .browserslistrc file.
@ytsurk can you check?
Comment #7
pivica CreditAttribution: pivica at MD Systems GmbH commentedTagging for next release.
Comment #8
ytsurkStill, this works as intended when updating or creating a theme.
Although I have 2 findings, which we should probably cover in a new issue:
1. When creating a theme, bs_versions is missing, so an immediate update after creation will walk through all update functions ..
I suggest we write the latest theme version in bs_boostrap info.yml, so it gets copied.
2. When creating a theme with a dash in it's name, like test-theme, _bs_base_drupal_scan is not finding it ..
I suggest we disallow theme names with other then alpha(-numeric) characters and the special char underscore (_).
Comment #9
pivica CreditAttribution: pivica at MD Systems GmbH commentedThanks for checking this.
Agree with follow-up issues, here they are:
Comment #10
pivica CreditAttribution: pivica at MD Systems GmbH commentedComment #12
pivica CreditAttribution: pivica at MD Systems GmbH commentedCommitted.