Development

#287 (sfPropelPager returns negative result in getLinks)

You must first sign up to be able to contribute.

Ticket #287 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

sfPropelPager returns negative result in getLinks

Reported by: tamcy Assigned to:
Priority: major Milestone:
Component: Version: 0.7.X
Keywords: Cc:
Qualification:

Description

As of changeset 891 in sfPropelPager.class.php, $begin can return negative page number.

e.g. Under the condition when

$nb_links = 10, $this->lastPage = 7, $this->page = 6

Since $tmp (which is 1) is larger than $this->lastPage - $nb_links + 1 (which is -2), -2 is assigned to $begin.

(Can't get svk running, thus no patch attached, sorry)

Change History

03/08/06 17:33:05 changed by seehiong@gmail.com

One possible way to solve this problem would be:

    $tmp = $this->page - floor($nb_links / 2);
    $check = $this->lastPage - $nb_links + 1;
    $limit = ($check > 0) ? $check : 1;
    $begin = ($tmp > 0) ? (($tmp > $limit) ? $limit : $tmp) : 1; 

03/13/06 20:15:21 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r968.