Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1551 - Redirect to the last page when current page is out of range #1700

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

delyriand
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documentation no
Translation no
Fixed tickets #1551
License MIT

@nicosomb nicosomb added this to the 2.0.0-beta.1 milestone Feb 19, 2016
$entries->setCurrentPage($page);
} catch (OutOfRangeCurrentPageException $e) {
if ($page > 1) {
return $this->redirect(str_replace('/' . $page, '/' . $entries->getNbPages(), $request->getRequestUri()), 301);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rather do:

return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you!

@j0k3r j0k3r added the Bug label Feb 19, 2016
@delyriand delyriand force-pushed the v2-fix-1551 branch 2 times, most recently from 97e8010 to 4d85a87 Compare February 19, 2016 13:55
$entries->setCurrentPage($page);
} catch (OutOfRangeCurrentPageException $e) {
if ($page > 1) {
return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())), 301);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could you put a 302 instead? You don't know if in the future you'll have the given page :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed ... in my mind, I wanted to make a temporary redirect :)

@j0k3r
Copy link
Member

j0k3r commented Feb 19, 2016

Thanks ! 👍

j0k3r added a commit that referenced this pull request Feb 19, 2016
Fix #1551 - Redirect to the last page when current page is out of range
@j0k3r j0k3r merged commit a8c6b8e into wallabag:v2 Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants