Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to set the force_ssl via Joomla! CLI fails #43736

Open
Yiannistaos opened this issue Jul 3, 2024 · 1 comment
Open

Try to set the force_ssl via Joomla! CLI fails #43736

Yiannistaos opened this issue Jul 3, 2024 · 1 comment

Comments

@Yiannistaos
Copy link

Steps to reproduce the issue

With Joomla! CLI I'm trying to set the force_ssl to the entire site.

php cli/joomla.php config:set sef=false mailonline=false force_ssl=2 -vvv

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

Screenshot 2024-07-03 at 14 42 04

Actual result

Screenshot 2024-07-03 at 14 41 38

Comments

It works fine with any other config variables. The problem is only with force_ssl.

@richard67
Copy link
Member

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 catchblock where the setUserState call fails.

So the question is what to do with that complete check at all when we are in the CLI.

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

No branches or pull requests

3 participants