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

{{ paginate:auto_links }} broken in Statamic 2.6.3 #1549

Closed
dorra opened this Issue Aug 13, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@dorra

dorra commented Aug 13, 2017

Expected behaviour

{{ paginate:auto_links }} should create links for each page like
<a href="http://www.site.com/blog?page=6">6</a>

Actual behaviour

It creates broken parameter strings like:
<a href="http://www.site.com/blog?page=2%3Fpage%3D3?page=6">6</a>

Steps to reproduce

  1. Create a collection template with {{ paginate:auto_links }}
  2. Click on Page Link 2,3,4,5,6
  3. Links do not work correctly, you get always page 2

Server Details

Operating System: Ubuntu

Web Server: Apache

PHP Version: 7.1

Statamic Version: 2.6.3

Updated from an older Statamic or fresh install: update

List of installed addons: none

@rrelmy

This comment has been minimized.

rrelmy commented Aug 13, 2017

This should fix the issue

Index: statamic/bundles/Collection/CollectionTags.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- statamic/bundles/Collection/CollectionTags.php	(date 1502631999000)
+++ statamic/bundles/Collection/CollectionTags.php	(revision )
@@ -500,7 +500,7 @@
 
         $paginator = new LengthAwarePaginator($items, $count, $this->limit, $page);
 
-        $paginator->setPath(request()->getUri());
+        $paginator->setPath(request()->url());
         $paginator->appends(Request::all());
 
         $this->pagination_data = [
@dorra

This comment has been minimized.

dorra commented Aug 13, 2017

This fix worked. Thanks a lot!

@dorra dorra closed this Aug 13, 2017

@dorra

This comment has been minimized.

dorra commented Aug 13, 2017

Ops. Still a Problem wrong taxonomy urls: http://www.site.com/blog/category/blog/category/marketing?page=3

@dorra dorra reopened this Aug 13, 2017

@rrelmy

This comment has been minimized.

rrelmy commented Aug 13, 2017

I updated the patch above to use ->url() instead of ->path().

@jasonvarga jasonvarga changed the title from URGENT {{ paginate:auto_links }} broken in Statamic 2.6.3 to {{ paginate:auto_links }} broken in Statamic 2.6.3 Aug 13, 2017

@jasonvarga jasonvarga closed this Aug 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment