-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated to 1.30.0 - PHP warning: Deprecated function: version_compare(): Passing null to parameter #1 #6835
Comments
@jenlampton the STR seem incomplete. I have one site with a subtheme of basis and that never showed that warning (PHP 8.1). Whether the base theme's enabled or disabled shouldn't matter, as its template.php will be considered regardless. Param 1 is the update_version added in an update hook. Could it be, that this Backdrop instance is patched in any way, so crucial code is missing, or the update hook didn't run? https://github.com/backdrop/backdrop/blob/1.x/core/themes/basis/template.php#L69 Edit: had to correct some of the text. |
To circumvent this problem, I enabled Basis when I ran the update, and then disabled Basis again after the update was complete.
|
I think the problem I ran into is that the update hook checks if the Basis theme is enabled before setting the value: function system_update_1100() {
$themes = system_list('theme');
if (!empty($themes['basis']->status)) { |
What happens when someone who's not using Basis when this update happens, wants to switch back to Basis later? When they first installed their site, Basis worked fine. But without this update, if they ever switch back to Basis they are also going to get this error if these values are only set if the theme is enabled at update-time. Because there's no |
Oh, nice catch, didn't realize that. 👍
@jenlampton I wonder, why you decided against fixing the problem in basis_preprocess_page() with a simple |
I just played with that. This works properly. Basis has a config folder. If Basis gets disabled, its config gets wiped out from the active config folder and if it's enabled again later on, the "vanilla" config is added into the active config. |
I made up my mind... Back to needs testing/review. Although I find it unnecessary to add yet another update hook to fix that warning, I don't want to block anything. Obviously I didn't follow the discussions that led to the changes, that astounded me. 😁 |
Description of the bug
I'm seeing the following warning after updating to 1.30.0
I think maybe
Steps To Reproduce
To reproduce the behavior:
Actual behavior
PHP error
Expected behavior
No error
Additional information
Add any other information that could help, such as:
Backdrop CMS: 1.30.0
Installation profile: standard
PHP version: 8.2.24
Drupal 7 compatibility: on
Database server: 10.11.9-MariaDB-ubu2204-log
Web server: nginx/1.26.2
The text was updated successfully, but these errors were encountered: