• We noticed that the paging links at the bottom of the event list are incomplete on first page load, and correct links are generated only upon retrieving a new event list with AJAX.

    Link before AJAX (incorrect): /?em_search=&category=&pno=2

    Link after AJAX (correct): /en/?em_search=&category=&scope=[REMOVED]&town=[REMOVED]&country=[REMOVED]&action=search_events_grouped&pno=2

    The only thing in between was the clicking of the Search button.

    Could you make the first page load generate the href link in the same way as with AJAX?

    https://wordpress.org/plugins/events-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Daedalon

    (@daedalon)

    Looking for the possible cause I made classes/em-events.php‘s get_pagination_links() output the contents of $default_args with print_r(). Before the if clause on line 322 the $default_args were empty with or without AJAX. After the if, however, there was a difference: the before AJAX version of the array was missing two keys.

    Before AJAX:

    [tag] => 0
         =>
         =>
        [offset] => 0

    After AJAX:

    [tag] => 0
        [location] =>
        [event] =>
        [offset] => 0

    Also the $args had several differences. Before AJAX it had several variables more, and in AJAX the scope was changed. Everything else was identical.

    Before AJAX:

    [order] => ASC
        [action] => search_events_grouped
        [em_search] =>
        [scope] => Array
            (
                [0] =>
                [1] =>
            )

    After AJAX:

    [scope] => [THE DEFAULT SCOPE]

    Perhaps these help in looking for the cause and resolution for the issue. We’re using JavaScript window.history.pushState upon AJAX completion to make it always possible to copy and share the URL. Works currently everywhere except the paging links before AJAX.

    Thread Starter Daedalon

    (@daedalon)

    Any comments on making the AJAX paging links have the same target URL as non-AJAX ones?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Paging links incomplete before AJAX’ is closed to new replies.