Skip to content

Add null coalescing for fallback and general settings#1768

Open
manuelkleinert wants to merge 21 commits intopimcore:2025.4from
manuelkleinert:patch-1
Open

Add null coalescing for fallback and general settings#1768
manuelkleinert wants to merge 21 commits intopimcore:2025.4from
manuelkleinert:patch-1

Conversation

@manuelkleinert
Copy link
Copy Markdown

#This PR fixes multiple ErrorException: Warning: Undefined array key errors occurring in SystemSettingsProvider::prepareSettingsForUpdate when saving system settings in Pimcore

Studio.

#Changes in this pull request

  • Fixed multiple ErrorException: Warning: Undefined array key errors in SystemSettingsProvider::prepareSettingsForUpdate.
  • Added null coalescing operators (??) and default values to all fields in the prepareSettingsForUpdate method to ensure stability when saving system settings.
  • Specifically addressed missing keys for:
    • fallback_languages (now defaults to an empty string/array).
    • localized error_pages (now safely handles missing paths).
    • Versioning settings for objects, assets, and documents (days, steps).
    • General settings like domain, required_languages, and debug_admin_translations.
    • Email debug addresses.

#Additional info

This issue occurred when the Pimcore Studio UI sent settings data where certain optional or language-specific fields were missing, causing a 500 Internal Server Error during the
preparation of the update. By adding these safeguards, the backend is now more resilient to incomplete or empty configuration sets, allowing the save process to complete
successfully regardless of the current configuration state.

@sonarqubecloud
Copy link
Copy Markdown

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 26 complexity · 0 duplication

Metric Results
Complexity 26
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@martineiber martineiber added this to the 2025.4.1 milestone Apr 20, 2026
@martineiber
Copy link
Copy Markdown
Contributor

@manuelkleinert Thank you for the Contribution. Could you rebase this PR to 2025.4?

@manuelkleinert manuelkleinert changed the base branch from 2026.x to 2026.1 April 21, 2026 07:53
@AndrewKMoses
Copy link
Copy Markdown

We have more of these type of errors, but for the function getDocumentSettings and the key error_pages. Could we include the fix for that in this PR?

@martineiber
Copy link
Copy Markdown
Contributor

martineiber commented Apr 30, 2026

@manuelkleinert We would like to include this into 2025.4, Would be nice if you can rebase this PR.

@martineiber
Copy link
Copy Markdown
Contributor

We have more of these type of errors, but for the function getDocumentSettings and the key error_pages. Could we include the fix for that in this PR?

When the PR is rebased to 2025.4 We can include this. Is it only for error_pages?

@AndrewKMoses
Copy link
Copy Markdown

We have more of these type of errors, but for the function getDocumentSettings and the key error_pages. Could we include the fix for that in this PR?

When the PR is rebased to 2025.4 We can include this. Is it only for error_pages?

Yes

@manuelkleinert manuelkleinert changed the base branch from 2026.1 to 2025.4 April 30, 2026 09:53
@manuelkleinert
Copy link
Copy Markdown
Author

@manuelkleinert We would like to include this into 2025.4, Would be nice if you can rebase this PR.

I have made the adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants