Support » Plugin: Events Manager » possibly small bug when using [events_list]

  • Resolved leoloso


    Hi Marcus again, I found another small bug

    I want to add an Events page with
    – The Upcoming Events, paginated
    – The past Events, not paginated

    [events_list scope="future" limit=10 pagination=true]
    [events_list scope="past" limit=5 order=DESC page=1]

    as you can see I add page=1 in the second list, this should fix it to that page, and not take param “pno” when paginating the first list

    However this doesn’t work, so when going to the second page of the first list, the second list also goes to its second page

    I saw in function em_get_events_list_shortcode you have:

    $atts['page'] = ( !empty($atts['page']) && is_numeric($atts['page']) )? $atts['page'] : 1;
    $atts['page'] = ( !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : $atts['page'];

    So then param “pno”, if it exists, will override that arg page. I think it should be the opposite: it should take param “pno” unless it is defined in the args

    So I changed those 2 lines into this:

    $pno = ( !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : 1;
    $atts['page'] = ( !empty($atts['page']) && is_numeric($atts['page']) )? $atts['page'] : $pno;

    I hope you agree with this change

    Cheers again

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    I get this too, however don’t think that this is a bug since you can trying to add 2 shortcodes with pagination on the same page which confuses the two I think? but maybe @marcus does have any idea about this.

    Plugin Author Marcus


    this is somewhat inevitable. We use the same variable to detect page numbering so any item of ours on a page using pagination would share it with other items of ours using pagination.

    You’d need to change pno to something else in the code we use to generate a specific bit of information to have it show differently.

    Hi Marcus, yes I understand completely, however in my opinion the argument in the shortcode should have more priority that the param, since you’re fixing the value to what is desired… a kind of force_status… at least that’s my impression, but I understand if you think it’s the other way around

    Plugin Author Marcus


    i see what you mean (sorry i skimmed the question a bit :))…

    I’ve noted this down but it might not get done in the next update, will check this out asap.

    Plugin Author Marcus


    FYI, this has been fixed in the latest dev version and will be in the next update.

    awesome, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘possibly small bug when using [events_list]’ is closed to new replies.