Replies: 7 comments
-
Dear Joomla team @joomla-cms-bot Could you please fix this issue in the next version of the Joomla 4 and Joomla 5. |
Beta Was this translation helpful? Give feedback.
-
I do not know how it can be fixed. And whether it can be fixed. // Keep CLI app
$cliApp = \Joomla\CMS\Factory::$application;
// Assign the Administrator application to the Factory
$adminApp = \Joomla\CMS\Factory::getContainer()->get(\Joomla\CMS\Application\AdministratorApplication::class);
\Joomla\CMS\Factory::$application = $adminApp;
// Run your code
....
....
// Restore the CLI app
\Joomla\CMS\Factory::$application = $cliApp; |
Beta Was this translation helpful? Give feedback.
-
Hello @Fedik, Thank you for your reply. I would like to provide more specific information on this issue. And for our Geek ElasticSearch component, we developed a CLI application that enables users to index data of supported 3rd-party components from a command-line interface (Like the Indexer command of SmartSearch/Finder component). When indexing data of one 3rd-party component (e.g: Kunena), it will need to call the "buildRoute" method of the Router class of Kunena component.
But the "CliApplication" is not extended from the "CMSApplication", so it does have the method "getMenu". I can't edit the Router class of 3rd party components to fix this issue. I hope it provided enough information. |
Beta Was this translation helpful? Give feedback.
-
Sounds more like an issue with the way kunena is written if it is reliant on the menu |
Beta Was this translation helpful? Give feedback.
-
Hello @brianteeman There are many components write their Router class this way to lookup menu Itemid and build self url of items, such as Eshop, Fabrik, Hikashop, JGive .. |
Beta Was this translation helpful? Give feedback.
-
I don't want to judge on this issue yet, but: You should NEVER store the Itemid in the database/index of smart search, since then the Itemid is stored statically there. But if you change your menu structure, unpublish a menu item or create a "better" fitting menu item for a content item, all your old, stored URLs are broken. That is why you should not create a URL like |
Beta Was this translation helpful? Give feedback.
-
Same problem with joomla 5 cli and kunena for indexing : php -d memory_limit=512M joomla.php finder:index Finder IndexerStarting Indexer In KunenaRoute.php line 902: |
Beta Was this translation helpful? Give feedback.
-
Dear Joomla Development Team,
I'm a developer of Geek ElasticSearch component.
My component supports index and search data of Joomla core components and many 3rd party components.
It enables users to index data manually in the search component dashboard, or create a cron job to incremental index new items automatically with CLI script / command (is similar to a CLI script of Smart Search)
The CLI script in Joomla 3 was extended of CliApplication, and it was working well.
In Joomla 4, it uses the ConsoleApplication to execute CLI commands. But the ConsoleApplication does not support a method getMenu() like the AdministratorApplication (used for Backend) and the SiteApplication (used for Frontend).
So this causes an error when indexing data of some 3rd party components since the Route class of these components needs to call the getMenu() method of the Application to get their menu items and build SEF URLs.
Could you please consider adding this method to the ConsoleApplication class in the next release of Joomla 4?
Thank you.
Best regards,
Thanh Nguyen
Beta Was this translation helpful? Give feedback.
All reactions