By adiehm on Saturday, 08 April 2017
Replies 11
Likes 0
Views 1.6K
Votes 0
The Next Month and Previous Month links are either broken or not showing.

It seems that the following piece of code in each view/template-name/month/tmpl/calendar)body.php does not work

$followingMonth and $precedingMonth are both empty/Null

// previous and following month names and links
$followingMonth = $this->datamodel->getFollowingMonth($this->data);
$precedingMonth = $this->datamodel->getPrecedingMonth($this->data);

I'm deploying Jevents on a new website and need this functionality to work asap - thanks in advance
Hello,

Please make sure the Past and future years are set as -1y and +3y in the JEvents Global config.

Many thanks
Tony
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I assume your referring to jevents / configuration / Componenet
First Year to Display in Calendar or Years From Now : +3
Last Year to Display in Calendar or Years Before Now : -1
These were set to +2 and - 2
Has no impact - Next and previous months still do not work, I have tried it on 2 templates "Alternative" and "Flat"
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Please can you provide your JEvents Support Info from your JEvents Control panel on your website?

Many thanks
Tony
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·

PHP Version : 7.0.17
MySQL Version : 5.5.54
Server Information : Linux lsh12.conetix.com.au 2.6.32-042stab117.11 #1 SMP Thu Aug 11 09:41:14 MSK 2016 x86_64
Fix jQuery? : Yes
Load JEvents Bootstrap CSS? : Yes
Max Input Vars ? : 1000
Club code set? : No
User Agent : Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Joomla : 3.6.5
component_com_jevents : 3.4.33
component_com_jce : 2.6.9
component_com_comprofiler : 2.1.2
module_mod_jevents_cal : 3.4.33
module_mod_jevents_custom : 3.4.33
module_mod_jevents_filter : 3.4.33
module_mod_jevents_latest : 3.4.33
module_mod_jevents_legend : 3.4.33
module_mod_jevents_switchview : 3.4.33
plugin_content_jevents : 3.4.33
plugin_finder_jevents : 3.4.33 (not enabled)
plugin_installer_jeventsinstaller : 3.4.33
plugin_search_eventsearch : 3.4.33
plugin_system_gwejson : 3.4.33
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
That is very strange - the other months do work (http://dev.jagqld.org.au/index.php/calendar/monthcalendar/2017/10/-?jEV=flat)

I don't see how $this->datamodel->getPrecedingMonth($this->data); can return a null - it will either return an array of data or a false.

in the getAdjecentMonth function in components/com_jevents/libraries/datamodel.php at line c. 1117 find the code

if ($year>$latestyear || $year<$earliestyear){
return false;
}

and replace it with

echo "year = $year latest = $latestyear earliest = $earliestyear<br/>";
if ($year>$latestyear || $year<$earliestyear){
return false;
}
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I have added in the required code change. Both variables echoed in new line are empty

http://dev.jagqld.org.au/index.php/calendar/monthcalendar/2017/10/-?jEV=flat

The links on this future calendar do not work, The left/right arrows displayed are a CSS background image, The href links generated in the code are empty like other calendar templates, see attached image
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
That is REALLY strange - the diagnostic code appears to be outputting 'latestyear' but its not even part of what we put i the code.

Can you give me super user login details on the private 'site details' tab below and I'll take a look at what is going on.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Information provided
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I went back and checked the code change and noticed i had placed it in one of the following Functions "getAdjacentWeek" which happens to contain the same IF statement.

This revealed the problem - The years were reversed
year = 2017 latest = 2014 earliest = 2020
year = 2017 latest = 2014 earliest = 2020

The Instructions on the Component Config screen seem to be reversed - See Attached image

Following these instructions I set the following options:
First Year to Display in Calendar or Years From Now : +3
Last Year to Display in Calendar or Years Before Now: -3
This gives the years reversed

When i change the settings as follows the calendar works as expected
First Year to Display in Calendar or Years From Now : -3
Last Year to Display in Calendar or Years Before Now : +3

year = 2017 latest = 2020 earliest = 2014
year = 2017 latest = 2020 earliest = 2014

I think the instructions are right and use of + or - years are right. It looks like there is a coding problem or the fields are reversed some where.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
You are right - our translations are not good. I will review for the next release.

Good detective work.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post