Skip to content

Routing: Legacy Router Rule for com_content#5501

Closed
Hackwar wants to merge 65 commits intojoomla:stagingfrom
Hackwar:com_content_router_legacy
Closed

Routing: Legacy Router Rule for com_content#5501
Hackwar wants to merge 65 commits intojoomla:stagingfrom
Hackwar:com_content_router_legacy

Conversation

@Hackwar
Copy link
Copy Markdown
Member

@Hackwar Hackwar commented Dec 23, 2014

This implements the current routers behavior of com_content as a legacyrouter. This is meant for those that want to keep the old behavior at all costs. Later, parameters will be introduced to switch between the legacy behavior and new features.

This router is copied verbatim from the current router to make sure that the same behavior is kept. No changes should be done to it until Joomla 4.0, when this is supposed to be deleted. The component routers right now are so fragile, that a slow transition will be next to impossible. To prevent any breaks in backwards compatibility, this legacy router is introduced, so that people having problems with the new router can switch back.

How to test

  1. Check your site before applying the patch and see the URLs of com_content.
  2. Apply the patch.
  3. See the URLs of com_content to stay the same.

This was made possible through the generous donation of the people mentioned in the following link via an Indiegogo campaign: http://joomlager.de/crowdfunding/5-contributors

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Dec 23, 2014

@Hackwar Travis fails on:

There was 1 error:
1) JRouterSiteTest::testGetComponentRouter
Invalid argument supplied for foreach()
/home/travis/build/joomla/joomla-cms/libraries/cms/component/router/rules/menu.php:147
/home/travis/build/joomla/joomla-cms/libraries/cms/component/router/rules/menu.php:44
/home/travis/build/joomla/joomla-cms/components/com_content/router.php:30
/home/travis/build/joomla/joomla-cms/libraries/cms/router/site.php:690
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php:791

also two CS issues: (see: Hackwar#14)

FILE: ...build/joomla/joomla-cms/components/com_content/helpers/legacyrouter.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
  48 | ERROR | Whitespace found at end of line
 479 | ERROR | Please end your files with an empty line.
--------------------------------------------------------------------------------

https://travis-ci.org/joomla/joomla-cms/jobs/44966357

Fix CS issues that was found by Travis
@Hackwar
Copy link
Copy Markdown
Member Author

Hackwar commented Dec 23, 2014

thx @zero-24

@paternax
Copy link
Copy Markdown

Klicking on a tag of a tagged article gives following notices:
Notice: Trying to get property of non-object in C:\xampp\htdocs\joomla-cms\libraries\cms\component\router\rules\menu.php on line 58


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

Hackwar and others added 19 commits March 22, 2015 12:58
Call-time pass-by-reference has been removed

Removing JError, using Exception instead

protecting $name and renaming register() to registerView()

Adding removeRule, getRules and renamed $id to $key in register method

Making method names consistent

Implementing JComponentRouterViewconfiguration for configuration of views in JComponentRouterAdvanced

Codestyle, smaller improvements, unittests for all component router classes except for JComponentRouterAdvanced

Removing ability to have one view with different names and implementing unittests for JComponentRouterAdvanced

Adding get<View>Slug() and get<View>Key() methods to JComponentRouterAdvanced

Updating unittest

Small fixes

Adding back in platform check

Adding back in platform check

Adding back in platform check

Adding back in platform check

Implementing feedback so far

Adding "covers" notation for unittests
…omponentrulesitemid

Conflicts:
	tests/unit/suites/libraries/cms/component/router/JComponentRouterViewTest.php
Fix unit test failure in JComponentRouterViewTest
…into com_content_router_legacy

Conflicts:
	components/com_content/helpers/route.php
@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label May 23, 2015
@Hackwar
Copy link
Copy Markdown
Member Author

Hackwar commented May 23, 2015

This has been updated to work with the latest implementation of JComponentRouterView. Please test.

@Hackwar
Copy link
Copy Markdown
Member Author

Hackwar commented Aug 2, 2015

I've combined the changes from this and all other routing related PRs into a new PR: #7615 Please review and comment in the new PR. I'm closing this one, so that we can focuse on the new PR.

@Hackwar Hackwar closed this Aug 2, 2015
@Hackwar Hackwar deleted the com_content_router_legacy branch January 6, 2016 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants