[SOLVED] New pages added a System Page

Permalink 1 user found helpful
Hi,
I'm currently working on a multi-language, I first started with C5 version 8.0.1. Now i've upgraded to the lastest (8.3.1) version and with pleasure I've seen that sitemap works quite better than it used to. Unfortunately, when i try adding a new page on the second language, this get added as a systempage (I've looked into db and seen that is has cIsSystemPage column set to 1). Of course this mean I can see new pages only if i check "show system pages" in sitemap. It doesn't happen with main language.
Any ideas?

Thanks in advance

 
nickname1794 replied on at Permalink Reply
Ok, after a few debug I've found the part of the code that set it to systempage.
Concrete\Core\Page, method rescanSystemPageStatus() at a certain point there is:
if (is_object($c) && !$c->isError()) {
     if ($c->getCollectionParentID() == 0 && !$c->isHomePage()) {
            $systemPage = true;
     }
}

Now, everything works fine if we are under the main language cause $c->getCollectionParentID() will be 0 but isHomePage will return true, thus not setting it a systempage. But if i add a child to the homepage of my second language, $c appears not to be homepage and this setting it as a systempage.
Is it a bug or am i doing it wrong?
nickname1794 replied on at Permalink Reply
Ok, i've found the solution!
Problem is not actually in the code itself but inside database. After a long search I saw i had 2 rows in "PagePaths" table, they both had the slug for the homepage of the second language homepage. Problem is, first one was a dead page, it actually didn't exist and wasn't the one pointed from "SiteTree" table.
Deleted a few rows and it worked.
Maybe using external keys would have avoided this problem but it's just my opinion.

Thanks guys, I hope this will be usefull for others too.