ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Bug in query module pagination?

August 20, 2012 7:44am

Subscribe [3]
  • #1 / Aug 20, 2012 7:44am

    leeaston

    634 posts

    Latest EE.

    {pagination}
    {pagination_links}

    {/pagination_links}
    {/pagination}

    The inner pagination links pair is not parsed when used inside the query module, here is my template:

    {exp:query limit="10" paginate="bottom" sql="SELECT title, url_title, comment_total, view_count_one, recent_comment_date, allow_comments, name FROM exp_channel_titles LEFT JOIN exp_comments ON exp_comments.comment_date = exp_channel_titles.recent_comment_date  WHERE exp_channel_titles.channel_id = '38' AND comment_total > '0' ORDER BY recent_comment_date DESC"}
         {if count == 1}
          <table class="table">
           <tbody>
         {/if}
         <tr>
          <td><a href="http://{path=title={title}">{title} ({comment_total})</a> {if allow_comments == n}  <i class="icon-lock"></i> <span>small>Answered</small></span>{/if} {if sticky == 'y'}<i class="icon-bookmark"></i> {/if}</td>
          <td class="hidden-phone"><i class="icon-comment"></i> {comment_total} {if count == "1"}replies{/if}</td>
          <td class="hidden-phone"><i class="icon-eye-open"></i> 4 {if count == "1"}views{/if}</td>
          <td class="hidden-phone">
           {name}
          </td>
          <td class="hidden-phone">{recent_comment_date format="%g:%i %A"}</td>
         </tr>
         {if count == total_results}
          </tbody>
         </table>
         {/if}
         {paginate}
          {pagination_links}
           <ul>
           {first_page}
            <li><a href="http://{pagination_url}" class="page-first">First Page</a></li>
           {/first_page}
           
           {previous_page}
            <li><a href="http://{pagination_url}" class="page-previous">Previous Page</a></li>
           {/previous_page}
           
           {page}
            <li><a href="http://{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
           {/page}
           
           {next_page}
            <li><a href="http://{pagination_url}" class="page-next">Next Page</a></li>
           {/next_page}
           
           {last_page}
            <li><a href="http://{pagination_url}" class="page-last">Last Page</a></li>
           {/last_page}
           </ul>
          {/pagination_links}
         {/paginate}
        {/exp:query}

    The output is attached.

    Is this a bug? In the docs (http://ellislab.com/expressionengine/user-guide//modules/query/index.html#pagination) it says All variables and parameters used by the Channel and Comment Pagination are available for the Query module as well. So, you can specify where to put the pagination links and what type of pagination links to show.

    Best wishes
    Lee

  • #2 / Aug 20, 2012 12:33pm

    GDmac - expocom

    350 posts

    It seems the Query module doesn’t use the new EE Pagination library, that the channel-, comments- and search-modules use. (introduced in EE 2.4.0 http://ellislab.com/expressionengine/user-guide/changelog.html#version-2-4-0 )

    Looking at the source (EE 2.5.2), mod.channel.php (line 85) sets up the new pagination object, builds and renders the tags, whereas mod.query.php seems to use the more traditional method (line 160) $this->EE->pagination->initialize($config) and str_replace(LD.pagination_links.RD ...

    Since the documentation states “The pagination in the Query module works exactly like the Channel and Comment Pagination” (apart from limit=’‘), you could file a bug-report that the Query module doesn’t use the new pagination library.

    The active-record plugin is also affected by this, since it extends the query class from inside the query module.
    http://devot-ee.com/add-ons/activerecord

  • #3 / Aug 20, 2012 2:32pm

    leeaston

    634 posts

  • #4 / Aug 21, 2012 1:07pm

    Shane Eckert

    7174 posts

    Hi Lee,

    Thanks for filing the bug. Looks like it was accepted.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases