Autonav problems with 5.4.0.3

Permalink 1 user found helpful
I have an autonav in my theme hardcoded:
<?php
$btn = BlockType::getByHandle('autonav');
$btn->controller->mainCollection = $c;
$btn->controller->displayPages = 'second_level';
$btn->controller->orderBy = 'display_asc';                    
$btn->controller->displaySubPages = 'relevant';                    
$btn->controller->displaySubPageLevels = 'custom';
$btn->controller->displaySubPageLevelsNum = '1';
$btn->render('view');
?>

It worked fine until my update from 5.4.0 to 5.4.0.3. No it shows only the first level pages but no subpages as it did before. I can't find any reason for this.

cgrauer
 
chunksmurray replied on at Permalink Reply
chunksmurray
Take a look at Andrew's post here:http://www.concrete5.org/community/forums/chat/5-4-0-2-is-now-avail...

Seems it is a known issue. He suggests "To fix this in the meantime, you can download the original concrete 5.4.0 from our downloads page, and replace 5.4.0.3's concrete/blocks/autonav/controller.php with the original 5.4.0 autonav controller."
cgrauer replied on at Permalink Reply
cgrauer
Sorry, I didn't find the thread you linked. It really mentions my problem.

In the meantime I found this line in autonav's controller.php:
} else if (($this->displaySubPages == "relevant" || $this->displaySubPages == "relevant_breadcrumb") && (in_array($sortCID, $this->cParentIDArray) || $sortCID == $this->cID)) {


this condition is always false because $sortCID has no value... seems to be a relict from the previous version.
cgrauer replied on at Permalink Reply
cgrauer
PS: I changed it to
} else if (($this->displaySubPages == "relevant" || $this->displaySubPages == "relevant_breadcrumb") && (in_array($tc->getCollectionID(), $this->cParentIDArray) || $tc->getCollectionID() == $this->cID)) {


This works for me. I don't know if it's correct for every use. I just guessed...