Skip to content

Conversation

@Hackwar
Copy link
Member

@Hackwar Hackwar commented Mar 12, 2024

Pull Request for Issue #42991.

Summary of Changes

In an ideal world, the site router would only be created when necessary with the previously added onAfterInitialiseRouter event. However if a system plugin requests the site router object before all constructors of system plugins have run, the event would be fired, but no plugin would react to it, since the events haven't been registered yet. Since we can't guarantee that no one requests the router object prematurely, we have to revert the code and load the site router regardless of the application executed.

Testing Instructions

  1. Edit plugins/system/redirect/services/provider.php and insert $container->get(\Joomla\CMS\Router\SiteRouter::class); at line 43 (after '$plugin->setDatabase($container->get(DatabaseInterface::class));')
  2. Make sure the languagefilter plugin is enabled
  3. Open any page

Actual result BEFORE applying this Pull Request

The page throws an error.

Expected result AFTER applying this Pull Request

The page works fine.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@Fedik

This comment was marked as outdated.

@SniperSister
Copy link
Contributor

I have tested this item ✅ successfully on 479dcac

Works as described. For more info see my test comments in #43015


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43009.

@richard67
Copy link
Member

@Hackwar Does this close issue #42991 ?

@Hackwar
Copy link
Member Author

Hackwar commented Mar 13, 2024

yes

@Fedik
Copy link
Member

Fedik commented Mar 14, 2024

I have tested this item ✅ successfully on 479dcac


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43009.

@Fedik
Copy link
Member

Fedik commented Mar 14, 2024

r2c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43009.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 14, 2024
@LadySolveig LadySolveig merged commit 64bee12 into joomla:5.1-dev Mar 14, 2024
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 14, 2024
@LadySolveig
Copy link
Contributor

Thank you @Hackwar and for the support and testing @Fedik @SniperSister

@Hackwar Hackwar deleted the 5.1-router-event-revert branch March 18, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants