Menu

#1340 (in 2.6.0) Clicking last record goes to second to last page

2.6.0-beta2
invalid
1
2013-06-11
2004-07-19
No

There were 5 pages in one of my tables, I clicked the
last record button, it went to page 4 not page 5, it
kept doing this.

The only way I could get to page 5, is by using the
next button, or by selecting page 5 from the dropdown
box. but not by using the last record button like I
expected.

-------------------

Later on, more data was added to the same table, and it
became 6 pages, but like before, it was showing the
same behaviour, this time, clicking last record would
go to page 5, not page 6 like expected...

Discussion

  • Rob van der Linde

    Logged In: YES
    user_id=781727

    Actually, not even that, the only way I can get to the last
    page, is by using the dropdown box for page number, not
    using the next button like I said before, because the next
    button does not display on the second to last page at all.

     
  • Marc Delisle

    Marc Delisle - 2004-07-20
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2004-07-20

    Logged In: YES
    user_id=210714

    I can reproduce this problem. However, here, if I click on
    the last record (>>) button or if I choose the last page
    from the Page dropdown box, I see the end of the table but
    not the same number of rows. Can you confirm?

     
  • Michael Keck

    Michael Keck - 2004-07-30

    Logged In: YES
    user_id=224032

    Hi,

    I think the failure is in file libraries/display_tbl.lib.php on line
    #327:

    Please replace

    <input type="hidden" name="pos"
    value="<?php
    echo $unlim_num_rows - $session_max_rows;
    ?>" />

    with

    <input type="hidden" name="pos"
    value="<?php
    echo ((@ceil($unlim_num_rows / $session_max_rows)- 1)
    * $session_max_rows);
    ?>" />

    and it should work.

    Regards

    Michael

     
  • Alexander M. Turek

    Logged In: YES
    user_id=418833

    Michael,

    what kind of errors do you want to suppress with the '@'
    character?

     
  • Michael Keck

    Michael Keck - 2004-07-30

    Logged In: YES
    user_id=224032

    Hi Alexander,

    Sorry, I've only copied this little function from the pages-
    dropdownlist (some lines below). There is '@' used before ceil
    (...).
    I think it should suppress the php-error 'division by zero'.
    This maybe happen, if we have '0' rows. I know, if we
    have '0' rows the page shouldn't be loaded. But I feel better
    with '@' ;)

    Regards Michael

     
  • Marc Delisle

    Marc Delisle - 2004-08-03

    Logged In: YES
    user_id=210714

    Michael's patch merged.

     
  • Marc Delisle

    Marc Delisle - 2004-08-03
    • priority: 5 --> 1
    • summary: Clicking last record goes to second to last page, not last --> (in 2.6.0) Clicking last record goes to second to last page
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2004-09-27
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> invalid