Resolved Bug


This bug has been marked as resolved.

Problem with "Setup on child pages"

Permalink 1 0 Browser Info Environment
After creating a new page named "new1" belonging to pagetype "type1", I changed the name "new1" to "new2".

Then, I edited the pagetype and added a new block on "type1". When selecting "Setup on child Pages" on the new block, it showed "new1" in name field instead of "new2".

I think the query in collection_types.php(232) is not correct
$r = $db->query("select Pages.cID, Collections.cDateAdded, Collections.cDateModified, max(cvID) as cvID, cvName from Pages inner join Collections on Collections.cID = Pages.cID inner join CollectionVersions on Pages.cID = CollectionVersions.cID where ctID = ? and cIsTemplate = 0 group by CollectionVersions.cID order by cvName asc;", array($this->getCollectionTypeID()));

Because it showed the last cvID, but not the last cvName.

I changed the query as follow to get the last cvID and cvName.
$r = $db->query("select Pages.cID, Collections.cDateAdded, Collections.cDateModified, max(cvID) as cvID, cvName from Pages inner join Collections on Collections.cID = Pages.cID inner join (select * from CollectionVersions order by cvID desc) as Foo on Pages.cID = Foo.cID where ctID = ? and cIsTemplate = 0 group by Foo.cID order by cvName asc;", array($this->getCollectionTypeID()));


Status: Resolved
vipahhh replied on at Permalink
I can confirm the same thing. And the supplied query by syzlmr works.
Good job! :-)
12345j replied on at Permalink
12345j
thanks. Fixed in github.

concrete5 Environment Information

5.4.1.1

Browser User-Agent String

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10