ProBlog - Pagination Problem

Permalink
Hi,

Been having issues with problog pagination on a custom single page and wondered if anyone could shed some light on the issue?

I have tried contacting the developer but although he gave me a great reply this is not working and now I can't get hold of him.

Sorry to cross post but I wanted to open this up to the community

http://www.concrete5.org/marketplace/addons/problog/questions-and-d...

TMDesigns
 
TMDesigns replied on at Permalink Reply
TMDesigns
Still having issues with this, can anyone help?
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
If you have enabled full page caching, just try to disable it and clear your cache. Then try again. I'm having the same issue while ago and this tricks works for me. Maybe it will help you too.

Rony
TMDesigns replied on at Permalink Reply
TMDesigns
Hi,

I have tried that and it didn't help the code ends up like this.

<div class="ccm-next-previous-wrapper">
  <br>
  <div class="spacer"></div>
</div>
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Is the same shown for both logged in and non logged in situation?
TMDesigns replied on at Permalink Reply
TMDesigns
Yes, nothing shows up.
TMDesigns replied on at Permalink Reply
TMDesigns
I think that the page isn't pulling in the controller, is the code correct?
TMDesigns replied on at Permalink Reply
TMDesigns
Still haven't have an answer, really bugging me now.
exchangecore replied on at Permalink Reply
exchangecore
Did you take chadstrat's advice and try debugging? var_dump() and die() can go a long way in determining why something isn't behaving properly. If you need someone to help debug you can shoot me a PM and maybe we can work something out.

Edit: To be more clear I'm thinking that your problem may be related to the following:

var_dump($this->getNextPost());
die();


or thereabouts... But going through and making sure thinks like that are getting set properly could go a long way in helping determine where your problem actually is.
TMDesigns replied on at Permalink Reply
TMDesigns
Yes tried debugging and all I get is null.

Thanks, I'll PM you
exchangecore replied on at Permalink Best Answer Reply
exchangecore
Ok, so I managed to get this riddle solved. And the answer is...... It appears that the code (at least the stuff I modified) doesn't handle sites that are using a relative path. In this case Concrete5 was installed to /folderx/ so when it went to try and find other cID's with a similar page path, it was trying to include the DIR_REL configuration variable in the query for the $shorthand variable. The following functions are what I came up with to fix the issue in this particular case:


public function getNextPost(){
      global $c;
      $page_path = str_replace('/index.php','',Loader::helper('navigation')->getLinkToCollection($c));
      $link = $c->getCollectionHandle();
      $shortened = str_replace($link.'/','',$page_path);
      if(defined('DIR_REL')){     
         $shortened = str_replace(DIR_REL,'', $shortened);
      }
      $cID = $c->getCollectionID();
      $db = Loader::db();
      $q = "SELECT cID FROM PagePaths WHERE cID > $cID AND cPath LIKE '%$shortened%' ORDER BY cID ASC";
      $ncID = $db->getOne($q);
      $np = Page::getByID($ncID);
      if($ncID){
         return Loader::helper('navigation')->getLinkToCollection($np);


special emphasis on the
if(defined('DIR_REL')){     
   $shortened = str_replace(DIR_REL,'', $shortened);
}
RadiantWeb replied on at Permalink Reply
RadiantWeb
Thank you exchangecore for your time and effort on that. I will add this change to the master. Next update should reflect that. Hopefully the core team fixes the darn nex/prev block and I can get rid of this.

Very sorry I have not had time to look into this more. I am away on vacation with my wife for our 15yr anniversary.

Apologies again for not being as accessible as I am normally.

ChadStrat
TMDesigns replied on at Permalink Reply
TMDesigns
Wow thank you so much for find a solution to this. I think I would have been there for ages and never thought of this. I really appreciate the time you have spent on this.

This is the reason I love Concrete5 we are all here to improve the code base.

Chad:
Hope you are having a good trip and thanks for you input.