Skip to content

Routing: Standard-behavior for components#5604

Closed
Hackwar wants to merge 173 commits intojoomla:stagingfrom
Hackwar:componentrulesstandard
Closed

Routing: Standard-behavior for components#5604
Hackwar wants to merge 173 commits intojoomla:stagingfrom
Hackwar:componentrulesstandard

Conversation

@Hackwar
Copy link
Copy Markdown
Member

@Hackwar Hackwar commented Jan 3, 2015

This PR implements a generic rule for standard behavior of components which routers extend from JComponentRouterAdvanced.

How to test

  • Apply this change

  • Change the router of com_content by replacing the code with the following:

    <?php
    class ContentRouter extends JComponentRouterAdvanced
    {
        public function __construct($app = null, $menu = null) {
    
            $this->registerView('categories', 'categories');
            $this->registerView('category', 'category', 'id', 'categories', '', true, array('default', 'blog'));
            $this->registerView('article', 'article', 'id', 'category', 'catid');
            $this->registerView('archive', 'archive');
            $this->registerView('featured', 'featured');
            $this->registerView('form', 'form');
            parent::__construct($app, $menu);
    
            $this->attachRule(new JComponentRouterRulesMenu($this));
            $this->attachRule(new JComponentRouterRulesNomenu($this));
            $this->attachRule(new JComponentRouterRulesStandard($this));
        }
    
        public function getArticleKey($segments, $vars)
        {
            return (int) $segments;
        }
    }
  • Comment line 69 and 123 from /components/com_content/helpers/route.php to disable the lookup of the Itemid there.

  • See that it creates sane URLs and that those URLs point to the right place.

Issues

This requires that #5446 and all depending requests are merged first. (You can still test this PR, since all changes from those PRs are included into this one.)

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

Hackwar and others added 30 commits December 16, 2014 16:51
Fix CS issues that was found by Travis
…s pretty complex and throws errors in our testing environment
Nicholas K. Dionysopoulos and others added 25 commits July 10, 2015 09:04
Conflicts:
	administrator/language/en-GB/en-GB.mod_status.ini
Composer update for Joomla Framework packages and PHPUnit
…omponentrulesstandard

Conflicts:
	tests/unit/suites/libraries/cms/router/JRouterSiteTest.php
@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 componentrulesstandard 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.