Bug report: Wrong URL for default page or first page

freeSbee

Hi all

Strange behavior in WB version 2.8.3 SP6 / Revision 1645 when showing the page menu using the native show_menu() function.

Initial situation

I have defined a page tree as follows:

FirstLevelPage1
    SecondLevelPage1
    SecondLevelPage2
    SecondLevelPage3
    SecondLevelPage4
FirstLevelPage2
[and so on ...]


Result

To my surprise the page URLs look as follows.
WB takes the first sublevel page as default page instead of the first firstlevel page.

www.example.com/pages/firstlevelpage1.php
    www.example.com
    www.example.com/pages/firstlevelpage1/secondlevelpage2.php
    www.example.com/pages/firstlevelpage1/secondlevelpage3.php
    www.example.com/pages/firstlevelpage1/secondlevelpage4.php
www.example.com/pages/firstlevelpage2.php
[and so on ...]


Expected result

www.example.com
    www.example.com/pages/firstlevelpage1/secondlevelpage1.php
    www.example.com/pages/firstlevelpage1/secondlevelpage2.php
    www.example.com/pages/firstlevelpage1/secondlevelpage3.php
    www.example.com/pages/firstlevelpage1/secondlevelpage4.php
www.example.com/pages/firstlevelpage2.php
[and so on ...]


Fix

class frontend
function page_select()
about line 95

Replace
. ' ORDER BY  `p`.`position` ASC';
by
. ' ORDER BY  `level`, `p`.`position` ASC';

Regards Christoph