Skip to content
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

Fixed website and theme status ActiveButtons (PHP 8) #406

Merged
merged 3 commits into from
Jan 28, 2024
Merged

Fixed website and theme status ActiveButtons (PHP 8) #406

merged 3 commits into from
Jan 28, 2024

Conversation

hbugdoll
Copy link
Member

@hbugdoll hbugdoll commented Jan 28, 2024

What are you changing/introducing

  • Set explicitly enableValue=1 and disableValue=0 for ToggleStatusActiveButton in Website and Theme model.

What is the reason for changing/introducing

Rector replaced the switch statement in luya-module-admin/src/buttons/ToggleStatusActiveButton::toggleValue() with new PHP 8 match statement (see luyadev/luya-module-admin@5e0574a).

Because of

Unlike switch, the comparison is an identity check (===) rather than a weak equality check (==).
https://www.php.net/manual/en/control-structures.match.php

toggling to other values than true or false leads into an InvalidArgumentException.

QA

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues Closes #405

@nadar
Copy link
Member

nadar commented Jan 28, 2024

Perfect! Thanks

@nadar nadar merged commit 2205b81 into luyadev:master Jan 28, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while toggling website default status
2 participants