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.
notice: Undefined variable: form_values in /var/www/www.astrocalc.com/htdocs/sites/all/modules/switchtheme/switchtheme.module on line 151.
a review with coder module shows:
switchtheme.module
*
severity: critical Line 151: use $form_state['values'] instead, which is where the values are stored after a submit
variable_set('theme_default', $form_values['custom_theme']);
Comment | File | Size | Author |
---|---|---|---|
#3 | switchtheme.patch | 758 bytes | sun |
Comments
Comment #1
yettyn CreditAttribution: yettyn commentedand the fix:
changing
variable_set('theme_default', $form_values['custom_theme']);
to
variable_set('theme_default', $form_state['values']['custom_theme']);
fixes it ;-)
Comment #2
yettyn CreditAttribution: yettyn commentedComment #3
sunIMHO, SwitchTheme should never ever allow users to switch the default theme of a site. This happens exactly in this line.
Instead of fixing this bug, I'd propose to remove the line completely.
The same change is already incorporated in the the patch in #185254: Themes don't switch for anonymous users.
Comment #4
sunMarking as duplicate of #247348: Switchtheme switches the default theme not the users'