ViewMode buttons on the Reservation Lava Block setting preferences causes error.
The ViewMode buttons (Day, Week, Month) set the preference on each click to their associated modes:
The function SetFilterControls checks for this preference, and only assigns a default if the preference does not exist:
Using the block more than once (i.e. with different configurations) will still set the preference for the Day, Week, or Month on button click. Since the configurations may differ between them (Day/Week view disabled, for example) the preference may be valid for one page, but not the other.
Since SetFilterControls only assigns a default if the preference does not exist, the Configuration Error will show if the user last clicked a button on another page that is not supported with the current page's configuration.
Steps to Reproduce
Create 2 pages that use this block
On one page, disable Day/Week Views.
One the other page, click "Day"
Navigate to the other page
See error
Expected behavior:
Default to a valid ViewMode if the preference is not valid for the current configuration
Prerequisites
Description
ViewMode buttons on the Reservation Lava Block setting preferences causes error.
The ViewMode buttons (Day, Week, Month) set the preference on each click to their associated modes:
The function SetFilterControls checks for this preference, and only assigns a default if the preference does not exist:
Using the block more than once (i.e. with different configurations) will still set the preference for the Day, Week, or Month on button click. Since the configurations may differ between them (Day/Week view disabled, for example) the preference may be valid for one page, but not the other.
Since SetFilterControls only assigns a default if the preference does not exist, the Configuration Error will show if the user last clicked a button on another page that is not supported with the current page's configuration.
Steps to Reproduce
Expected behavior:
Default to a valid ViewMode if the preference is not valid for the current configuration
Actual behavior:
Configuration Error
Versions