Home › Forums › Calendar Products › Events Calendar PRO › [Bug report] TribeEvents::uglyLink() missing ‘day’
- This topic has 10 replies, 4 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
April 20, 2012 at 2:06 am #18089
Ulli
ParticipantI was wondering why tribe_get_day_link() was not working as expected given a valid date. I haven’t changed permalink structure yet 😉
Copying the ‘month’ statement in uglyLink() and modifying it for ‘day’ did the trick.
ECP 2.0.5
April 23, 2012 at 7:43 am #18138Rob
MemberInteresting point here, Ulli. Thanks for bringing it up. Not sure the ramifications of this but I’ve asked our dev Jonah to take a look here when he hits the forums today. Stay tuned.
April 23, 2012 at 10:33 am #18182Jonah
ParticipantHi Ulli, can you elaborate a little more on this and provide some examples?
April 23, 2012 at 8:25 pm #18227Ulli
ParticipantI wanted the day in the calendar widget to be clickable, but the link i got from functions like tribe_get_day_link() or tribe_get_linked_day() never had any date part in the returned URL, only ‘?post_type=tribe_events’
In my table-mini.php:
$return .= ( count($monthView[$day]) ) ? “$day” : $day;The $date i generate via date(‘d.m.Y’, …) from parameters passed to tribe_mini_display_day() and is valid for that day, e.g. ‘02.04.2012’.
tribe_get_day_link() calls getLink(‘day’, $date) in class TribeEvents, which has a check for permalink structure, either calling uglyLink($type, $secondary) or running a switch-case statement for $type. That switch statement has ‘day’ as option. But in my case it calls uglyLink which also has a switch-case but is lacking that ‘day’ option.
So i added this to the switch-case in uglyLink() to get it working:
case ‘day’:
$day = add_query_arg( array( ‘eventDisplay’ => ‘day’), $eventUrl );
if ( $secondary )
$day = add_query_arg( array( ‘eventDate’ => $secondary ), $day );
return $day;Hope that helped a bit.
April 23, 2012 at 8:34 pm #18228Ulli
ParticipantOops, it didn’t escape that HTML part from my table-mini.php line.
I just call tribe_get_day_link($day) there.April 23, 2012 at 8:36 pm #18229Ulli
ParticipantMake that tribe_get_day_link($date) sorry, 5AM here and not enough coffee yet. 🙂
April 24, 2012 at 5:03 pm #18252Jonah
ParticipantYou could also use something like this: https://gist.github.com/2293961
April 25, 2012 at 12:09 am #18261Ulli
ParticipantI do something similar like that Jonah, but as i tried to describe, tribe_get_day_link($date) is broken when you have no permalink structure set and use normal URL parameters. TribeEvents::uglyLink() does not know how to create a ‘day’ link.
April 25, 2012 at 10:02 am #18269Jonah
ParticipantHi Ulli, I’ve brought this up with another developer and will follow up here once I get a response.
April 26, 2012 at 10:21 am #18309Jonah
ParticipantHey Ulli,
It does appear this is a bug and we’ve got it fixed in an upcoming version. Thanks for the report and keep an eye out for the update 🙂
Cheers,
JonahJuly 7, 2015 at 6:19 am #976663Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘[Bug report] TribeEvents::uglyLink() missing ‘day’’ is closed to new replies.
