[Bug report] TribeEvents::uglyLink() missing ‘day’

Home Forums Calendar Products Events Calendar PRO [Bug report] TribeEvents::uglyLink() missing ‘day’

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #18089
    Ulli
    Participant

    I 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

    #18138
    Rob
    Member

    Interesting 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.

    #18182
    Jonah
    Participant

    Hi Ulli, can you elaborate a little more on this and provide some examples?

    #18227
    Ulli
    Participant

    I 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.

    #18228
    Ulli
    Participant

    Oops, it didn’t escape that HTML part from my table-mini.php line.
    I just call tribe_get_day_link($day) there.

    #18229
    Ulli
    Participant

    Make that tribe_get_day_link($date) sorry, 5AM here and not enough coffee yet. 🙂

    #18252
    Jonah
    Participant

    You could also use something like this: https://gist.github.com/2293961

    #18261
    Ulli
    Participant

    I 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.

    #18269
    Jonah
    Participant

    Hi Ulli, I’ve brought this up with another developer and will follow up here once I get a response.

    #18309
    Jonah
    Participant

    Hey 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,
    Jonah

    #976663
    Support Droid
    Keymaster

    This 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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘[Bug report] TribeEvents::uglyLink() missing ‘day’’ is closed to new replies.