statamic-pagereorder icon indicating copy to clipboard operation
statamic-pagereorder copied to clipboard

Statamic in subfolder not accounted for in hooks.pagereorder.php

Open joakimbording opened this issue 9 years ago • 0 comments

Tried build 0.3.0 on Statamic 1.10.3 with Chrome 40.0. Statamic installed in a subfolder.

After accounting for the subfolder problem in issue #9 reordering childpages worked fine, but I got an error if I tried reordering the top level folders. The error was cast at line 150 in hooks.pageredordering.php.

I managed to fix it by changing line 91 from:

        if ( isset($page->url) && $page->url == $url ) {

To:

        if ( isset($page->url) && substr(Config::getSiteRoot(),0,-1).$page->url == $url ) {

The substr is there to remove an extra /. There is probably a nicer way of doing this, but should give you an idea.

Love the add-on! :)

joakimbording avatar Mar 07 '15 11:03 joakimbording