By John Rankin on Friday, 24 January 2014
Posted in Technical Issues
Replies 3
Likes 0
Views 662
Votes 0
Hi Guys,

Help please, I am getting the above error on my clients site on the following page http://www.peoplepuzzles.co.uk/news-views (roll mouse over any item the archive blog listing in the module on the right) when clicking any of the archive links random pages are displayed that have little or nothing to do with the blog items, but pick up references to standard Joomla articles.

Please can you advise what I need to do to fix this urgently.

Thank you.

John
Hello John,

Is it possible provide us with your Joomla backend and FTP so we can check on this issues? Please advise.
·
Friday, 24 January 2014 23:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

It should not be necessary for you to access the admin area in order to see the error, as you only need to visit the page that I have provided as the link, and then roll your mouse over any of the links in order to see the problem, and then you can look at your source code to identify the issue. Unfortunately for security reasons I am not allowed to give thrid party access to the client servers, so unfortunately you are going to have to look into this another way, but I can confirm that this is definitely a bug in the code for the archive module.

As it happens I was not expecting such a quick reply so I have been looking into this further, and I think that I may have found the problem, and thus the solution.

While reviewing the URL, it is clear that there is a reference to the category id (e.g. the error message "undefined variable catid ... on line 38"), so it occurred to me that why would you want to include the category ID when you have already selected your chosen category, so with this in mind I reviwed the code in the "mod_easyblogarchive/tmpl/default_item.php" file on line 38, as reported in the error message, and sure enough there is a reference to appending the catid variable, see the block of code below (lines 37 to 42 in the above file):

---------------------------------------------- Code block -----------------------------------
<div class="mod-month">
<a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=archive&layout=calendar&archiveyear='.$i.'&archivemonth='.$monthSEF.$menuitemid ) . $catid; ?>" <?php if($defaultYear == $i && $defaultMonth == $m) echo 'style="font-weight:700;"'; ?>>
<?php echo $curDate->toFormat('%B'); ?>
<span class="mod-post-count">(<?php echo $postCounts->$i->$m; ?>)</span>
</a>
</div>
------------------------------------- End of code block -----------------------------------------

After a bit of investigating, I noted that none of the other "helper" or "model" files refer to any variable for the $catid, so I used the HTML override option with a copy of the above file, removed the reference to the $catid variable (see the amended code below), and lo and behold, it now all seems to work properly, though not knowing how it is supposed to be working, I cannot confirm this aprt from to say that there are now no errors, and the correct blog items for the given month are now being displayed.

-------------------------------------- Revised code block --------------------------------------
<div class="mod-month">
<a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=archive&layout=calendar&archiveyear='.$i.'&archivemonth='.$monthSEF.$menuitemid ); ?>" <?php if($defaultYear == $i && $defaultMonth == $m) echo 'style="font-weight:700;"'; ?>>
<?php echo $curDate->toFormat('%B'); ?>
<span class="mod-post-count">(<?php echo $postCounts->$i->$m; ?>)</span>
</a>
</div>
--------------------------------- End of revised code block --------------------------------------

Assuming that my fix is a valid one (all I did was remeove the code ". $catid" from the end of the "a href part of the generated URL), you may wish to update your core code accordingly, as I am sure that many others must be having the same issue when using the archive module to display a list of archived blog items, so hopefully this will help.

BTW the vesrsion of EasyBlog we are using is: v3.9.15210

Thank you.

Ps, I noticed that the code does not display as a block of code, so I have copied the code blocks into the attached text notepad file.
·
Saturday, 25 January 2014 00:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello John Rankin,

I am really sorry for the delay of this reply as it is a weekend for us here.
Thanks for your attached file and the information, the reason why i asking you provide us with the Joomla backend and FTP access detail is because the error message was so odd.
I also have tested in my local site, it work fine for me without remove the ". $catid". See my screenshot : http://screencast.com/t/Xhs792U0Ls , if you have configure only display this few category from the archive module list, so the url should be -> .../easyblog/archive/calendar/2014/01?modCid[]=3&modCid[]=2&modCid[]=5&
Could you mind give us a chance to help you investigate on this issues? We will glad to help you.
·
Sunday, 26 January 2014 22:12
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post