Skip to content

[6.x] Bugfix/settings timezone#18793

Merged
brandonkelly merged 6 commits into6.xfrom
bugfix/settings-timezone
May 6, 2026
Merged

[6.x] Bugfix/settings timezone#18793
brandonkelly merged 6 commits into6.xfrom
bugfix/settings-timezone

Conversation

@brianjhanson
Copy link
Copy Markdown
Contributor

Hat tip to @AugustMiller who noticed that trying to save the timezone as an environment variable would only submit the $.

This had already been fixed/updated in #18709 but wanted to make sure this page is working in 6.x nonetheless

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented May 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an issue on the General Settings screen where saving the timezone as an environment variable would only submit $, and aligns the 6.x General Settings UI/controller with the newer Inertia/CpScreenResponse patterns.

Changes:

  • Refactors GeneralSettingsController@index to return a CpScreenResponse and relies on shared craft.readOnly Inertia data.
  • Fixes env-var resolution during validation when saving settings (including boolean env vars via Env::parseBoolean()).
  • Replaces legacy combobox usage with new Vue combobox components/utilities and removes the old wrapper component.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Feature/Http/Controllers/Settings/GeneralSettingsControllerTest.php Updates the read-only assertion to use craft.readOnly shared Inertia props.
src/Http/Controllers/Settings/GeneralSettingsController.php Uses CpScreenResponse for the screen and improves env/boolean parsing on save.
resources/js/utils/transformBooleanOptions.ts Adds helper to decorate boolean env-var options with hint/indicator metadata.
resources/js/pages/SettingsGeneralPage.vue Migrates to new CraftCombobox/CraftInput usage and adds status option decoration.
resources/js/components/form/InputComboboxOption.vue Adds optional indicator rendering within combobox options.
resources/js/components/form/InputCombobox.vue Expands model/value handling and tweaks filtering (now stringifies option values).
resources/js/components/form/CraftCombobox.vue Switches to defineModel() and forwards slots into InputCombobox.
resources/js/components/Combobox.vue Removes deprecated legacy combobox wrapper component.
Comments suppressed due to low confidence (1)

resources/js/components/form/InputCombobox.vue:40

  • update:modelValue and transformModelValue are typed as returning/emitting string | number, but modelValue now also permits boolean and the default transformModelValue returns newValue.value (which can be non-string). Update the typings (and any downstream assumptions) so the emitted value type matches the supported modelValue types.
  const emit = defineEmits<{
    (e: 'update:modelValue', value: string | number): void;
  }>();
  const props = withDefaults(
    defineProps<{
      label?: string;
      options?: Array<SelectItem>;
      modelValue?: string | number | boolean;
      requireOptionMatch?: boolean;
      transformModelValue?: (newValue: SelectOption | null) => string;
      class?: HTMLAttributes['class'];
      placeholder?: string;
      disabled?: boolean;
    }>(),
    {
      modelValue: '',
      requireOptionMatch: false,
      options: () => [],
      transformModelValue: (newValue: SelectOption | undefined | null) =>
        newValue ? newValue.value : '',
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/js/components/form/InputCombobox.vue Outdated
Comment thread resources/js/components/form/CraftCombobox.vue
Comment thread resources/js/pages/SettingsGeneralPage.vue
Comment thread resources/js/pages/SettingsGeneralPage.vue
@brandonkelly brandonkelly merged commit d5b6a91 into 6.x May 6, 2026
16 checks passed
@brandonkelly brandonkelly deleted the bugfix/settings-timezone branch May 6, 2026 13:53
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.

3 participants