We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 reuse code from CLI, for example notify superuser
// Push a notification to the site's super users /** @var MessageModel $messageModel */ $messageModel = $this->app->bootComponent('com_messages')->getMVCFactory()->createModel('Message', 'Administrator'); //.... do something $_SERVER['HTTP_HOST'] = 'fake.url'; $username= 'fakeuser'; // Load com_message's language $language = Factory::getLanguage(); $language->load('com_messages', JPATH_ADMINISTRATOR, 'en-GB', false, true); $language->load('com_messages', JPATH_ADMINISTRATOR, null, true); $messageModel->notifySuperUsers( Text::_('PLG_SYSTEM_PRIVACYCONSENT_NOTIFICATION_USER_PRIVACY_EXPIRED_SUBJECT'), Text::sprintf('PLG_SYSTEM_PRIVACYCONSENT_NOTIFICATION_USER_PRIVACY_EXPIRED_MESSAGE', $username) );
able to call $messageModel->notifySuperUsers from CLI
$messageModel->notifySuperUsers
j4
as a quick dirty fix i've just added this method to ConsoleApplication.php https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Application/ConsoleApplication.php
public static function getRouter($name = null, array $options = array()) { $app = Factory::getApplication(); if (!isset($name)) { $name = $app->getName(); } $options['mode'] = $app->get('sef'); return Router::getInstance($name, $options); }
is there a better way ?
The text was updated successfully, but these errors were encountered:
fixed with #36332
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce the issue
try to reuse code from CLI, for example notify superuser
Expected result
able to call
$messageModel->notifySuperUsers
from CLIActual result
System information (as much as possible)
j4
Additional comments
as a quick dirty fix
i've just added this method to ConsoleApplication.php https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Application/ConsoleApplication.php
is there a better way ?
The text was updated successfully, but these errors were encountered: