News:

Dear jDownloads users, There is currently no Joomla 6 compatible version available. However, we are working on it and hope to release it shortly.

Main Menu
Support-Forum

Smart Index Error

Started by Gratia-Mira, 22.07.2024 10:11:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Arno

Hi Christoph,
thank you for coming back and for sharing your findings.

You are right: this is a CLI context issue. In CLI runs (e.g. `cli/joomla.php finder:index`), Joomla uses `ConsoleApplication`, and some web-only methods like `getMenu()` are not always available.

So your workaround direction is correct, and we will add a proper guard in the jDownloads route helper for both branches (4.x and 6.x), so CLI indexing does not fail in this situation.

Important note:
- This does not change normal frontend behavior.
- It only prevents route/menu lookups from crashing in CLI mode.

Please test again after the next update and let us know if indexing via cron/CLI is stable on your setup.

Thanks again for the precise technical hint.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  
    The following users thanked this post: Gratia-Mira

ColinM

Hi
Your analysis is absolutely correct: in CLI context there is no menu object like in normal web requests, so calling getMenu() directly can fail. Your workaround with method_exists() is a valid approach.

We have already implemented this fix on our side in both code lines:
jDownloads 4.x
jDownloads 6.x

The RouteHelper now guards menu access in CLI context (and in v6 we also added an additional identity/user safety guard for CLI paths). So yes, this will be included in the next upcoming releases.

ColinM
Colin M
  •  

ColinM

Hi
Your analysis is absolutely correct: in CLI context there is no menu object like in normal web requests, so calling getMenu() directly can fail. Your workaround with method_exists() is a valid approach.
So We have implemented this fix on our side in both code lines:
jDownloads 4.x
jDownloads 6.x

Many thanks
ColinM
Colin M
  •