Is the automatic direction change broken in the paginator for the latest Cake 3 release?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is the automatic direction change broken in the paginator for the latest Cake 3 release?

heavyKevy
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

euromark
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

heavyKevy
Sorry, I just updated to the latest 3.1.5,

here is an example link: http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
after clicking the weight link.
while the browser is showing the same link: http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
I would expect the new generated link to show desc...
It is not working correctly for me.
--Kevin

On Saturday, December 12, 2015 at 2:04:11 AM UTC+7, euromark wrote:
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

heavyKevy
Upon further examination, it works correctly for users, but fails for players....

On Saturday, December 12, 2015 at 4:08:21 AM UTC+7, heavyKevy wrote:
Sorry, I just updated to the latest 3.1.5,

here is an example link: <a href="http://127.0.0.1/baseball/players/search?sort=weight&amp;direction=asc" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;">http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
after clicking the weight link.
while the browser is showing the same link: <a href="http://127.0.0.1/baseball/players/search?sort=weight&amp;direction=asc" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;">http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
I would expect the new generated link to show desc...
It is not working correctly for me.
--Kevin

On Saturday, December 12, 2015 at 2:04:11 AM UTC+7, euromark wrote:
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

heavyKevy
I debugged it and discovered that sort options must be white listed if they are not part of the model.
I missed that in the documentation...


On Saturday, December 12, 2015 at 4:37:26 AM UTC+7, heavyKevy wrote:
Upon further examination, it works correctly for users, but fails for players....

On Saturday, December 12, 2015 at 4:08:21 AM UTC+7, heavyKevy wrote:
Sorry, I just updated to the latest 3.1.5,

here is an example link: <a href="http://127.0.0.1/baseball/players/search?sort=weight&amp;direction=asc" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;">http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
after clicking the weight link.
while the browser is showing the same link: <a href="http://127.0.0.1/baseball/players/search?sort=weight&amp;direction=asc" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%2Fbaseball%2Fplayers%2Fsearch%3Fsort%3Dweight%26direction%3Dasc\46sa\75D\46sntz\0751\46usg\75AFQjCNGghRm91Dh6aoegCE5KE_ZXD08M6g&#39;;return true;">http://127.0.0.1/baseball/players/search?sort=weight&direction=asc
I would expect the new generated link to show desc...
It is not working correctly for me.
--Kevin

On Saturday, December 12, 2015 at 2:04:11 AM UTC+7, euromark wrote:
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
my index method has the following baked code.
$this->paginate = [
            'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 'PrimaryPositions', 'SecondaryPositions']
        ];
    $this->set ( 'players', $this->paginate ( $this->Players ) );

And my index.ctp is the standard baked template with the following sort link:
  <th><?= $this->Paginator->sort('username') ?></th>

According to the documentation, if I click the title Username, it should default to ASC, then Alternate between ASC and DESC.
Mine never alternates...

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.