Open Yiannistaos opened 2 weeks ago
The exception happens here: https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_config/src/Model/ApplicationModel.php#L364
But the reason that the code goes into that catch
block is because Uri::getInstance()->getHost()
returns 'joomla.invalid'
here https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_config/src/Model/ApplicationModel.php#L340 when running in the CLI, and so the later HTTP request in line 354 fails, and we end in that catch
block where the setUserState
call fails.
So the question is what to do with that complete check at all when we are in the CLI.
A missing live site in the CLI might occur in more situations.
I think populateHttpHost should not set the SERVER if live_site is unset. and Uri should throw an exception if $_SERVER['HTTP_HOST'] is unset for $uri == 'SERVER'
Enforcing users to set the live_site when ever needed.
Steps to reproduce the issue
With Joomla! CLI I'm trying to set the
force_ssl
to the entire site.But I get an error in
administrator/components/com_config/src/Model/ApplicationModel.php
line 364:[Error] Call to undefined method Joomla\CMS\Application\ConsoleApplication::setUserState()
Expected result
Actual result
Comments
It works fine with any other config variables. The problem is only with
force_ssl
.