Page_router doesn't extend

edited July 2015 in Bug Reports
Hi there,

When attempting to extend Page_router, you'll find that it won't work correctly and will display 404 pages instead.

<?php

require_once(MODULES_PATH . '/fuel/controllers/page_router.php');

class MY_Page_router extends Page_router {

public function __construct() {
parent::__construct();
}

public function _remap($method) {
return parent::_remap($method);
}
}
?>

In routes I have:

$route['default_controller'] = 'my_page_router';
$route['404_override'] = 'my_page_router';

* http://forum.getfuelcms.com/discussion/237/question-on-location-and-modules/p1

Comments

  • edited 7:52AM
    Is it hitting your my_page_router controller at all?
  • edited 7:52AM
    Yes.

    parent::__construct(); seems to make it 404.
  • edited 7:52AM
    If it's hitting your MY_page_router's constructor, then it should be working correctly. Does the page you are trying to load even exist and if so is it a view or in the CMS? If in the CMS is the fuel_mode in the config set to "auto"?
  • edited 7:52AM
    It's hitting the MY_page_router's constructor, yes. It should be working correctly, but it isn't.

    There should be no behavioural difference between using "fuel/page_router" and "my_page_router", but there is.

    The page exists as a file view, but all I get is a 404.

    $config['fuel_mode'] = 'AUTO';
  • edited 7:52AM
    I think I see the issue and it only seems to occur on the homepage. I've post a fix on the develop branch:
    https://github.com/daylightstudio/FUEL-CMS/commit/75204dc8a8ce8325490919c9c66ae41d92d569ee
Sign In or Register to comment.