Skip to content

[5.3] Catch undefined cors options when saving global options#45103

Merged
bembelimen merged 3 commits intojoomla:5.3-devfrom
Digital-Peak:cli/config
Mar 14, 2025
Merged

[5.3] Catch undefined cors options when saving global options#45103
bembelimen merged 3 commits intojoomla:5.3-devfrom
Digital-Peak:cli/config

Conversation

@laoneo
Copy link
Member

@laoneo laoneo commented Mar 10, 2025

Summary of Changes

When saving an option on cli, then are undefined property warnings thrown on error reporting maximum. This happens only when Joomla is installed through cli with the php installation/joomla.php command.

Testing Instructions

Execut cli/joomla.php config:set debug=1 on the console within the joomla root folder.

Actual result BEFORE applying this Pull Request

The following four warnings are displayed:

Warning: Undefined array key "cors" in /var/www/html/Projects/cms5/administrator/components/com_config/src/Model/ApplicationModel.php on line 748

Warning: Undefined array key "cors_allow_origin" in /var/www/html/Projects/cms5/administrator/components/com_config/src/Model/ApplicationModel.php on line 749

Warning: Undefined array key "cors_allow_headers" in /var/www/html/Projects/cms5/administrator/components/com_config/src/Model/ApplicationModel.php on line 750

Warning: Undefined array key "cors_allow_methods" in /var/www/html/Projects/cms5/administrator/components/com_config/src/Model/ApplicationModel.php on line 751

Expected result AFTER applying this Pull Request

No warnings.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@muhme
Copy link
Contributor

muhme commented Mar 11, 2025

I have tested this item ✅ successfully on edf6bc8

Before applying this PR and if the four cors*-entries are deleted from configuration.php file, the four deprecation warnings are shown. After applying this PR no deprecation warnings are shown anymore and enabling/disabling Debug System continues to work with Joomla Command Line Interface.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45103.

@alikon
Copy link
Contributor

alikon commented Mar 11, 2025

I have tested this item ✅ successfully on edf6bc8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45103.

@alikon
Copy link
Contributor

alikon commented Mar 11, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45103.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 11, 2025
@bembelimen bembelimen merged commit 1bc5beb into joomla:5.3-dev Mar 14, 2025
4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 14, 2025
@bembelimen
Copy link
Contributor

Thx

@bembelimen bembelimen added this to the Joomla! 5.3.0 milestone Mar 14, 2025
@laoneo laoneo deleted the cli/config branch March 14, 2025 12:19
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.

5 participants