Skip to content

[6.1] Improve Multilanguage::getSiteHomePages() - fix for CLI app#47310

Closed
Denitz wants to merge 16 commits intojoomla:6.1-devfrom
Denitz:patch-8
Closed

[6.1] Improve Multilanguage::getSiteHomePages() - fix for CLI app#47310
Denitz wants to merge 16 commits intojoomla:6.1-devfrom
Denitz:patch-8

Conversation

@Denitz
Copy link
Contributor

@Denitz Denitz commented Mar 5, 2026

Pull Request resolves issue with merged #41507.

Summary of Changes

Keep old logic for CliApplication because it doesn't have getMenu() method defined in CMSWebApplicationInterface.

Testing Instructions

call Joomla\CMS\Language\Multilanguage::getSiteHomePages() in CLI command.

Actual result BEFORE applying this Pull Request

Error

Expected result AFTER applying this Pull Request

No error

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

# Conflicts:
#	libraries/src/Language/Multilanguage.php
#	libraries/src/Menu/AbstractMenu.php
@HLeithner
Copy link
Member

Thanks, but that's not a real solution. Now we have the same code twice and no long term solution. Any other idea? And a long time plan? maybe deprecated the support of applications which don't support the "menu"?


// Get all site homepages.
/** @var SiteMenu $menu */
$menu = Factory::getApplication()->getMenu('site');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will not work since ConsoleApplication has no getMenu() method.

@HLeithner
Copy link
Member

I think revert is the better way for the moment and deprecate the method and remove it in 8.0.

I checked the usages and all of them can directly or indirectly access the $app->getMenu().

@HLeithner
Copy link
Member

I'm closing this please see #41507 (comment)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants