Jump to content

possible bug in selector using `limit`


Martijn Geerts
 Share

Recommended Posts

version: 2.3.8

This works

$page->children(); // works
$pages->find("parent=$page"); // works
$page->children("start=0, limit=4"); // works
$page->children("limit=4"); // throws a fatal error
$pages->find("parent=$page, limit=4") // throws a fatal error

// Fatal error: Call to a member function children() on a non-object in /Users/martijn/Sites/www_domains/pvw/htdocs/wire/core/PageTraversal.php on line 205

Fatal error isn't thrown when adding start=0 to the selector.

Link to comment
Share on other sites

I tried those out and they all seem to work as expected for me (using the latest dev, 2.3.8). What's the page tree like? In what context are you running that code, in a template file or a module? Are you able to reproduce this behavior on a clean install? Or with some certain steps taken from a clean install?

  • Like 1
Link to comment
Share on other sites

It's quite an complex structure. Maybe the fault is on my side.

There are serveral finds on the same $pagearray, hasn't figured it out completely.

This is what I want:

I have a carousel, (listing pages when it has images),

next I have a throughput of pages, which includes the dropped pages of the carousel (pages with no images)

// Home Page (i stands for pages with image)

carousel:
+-+   +-+   +-+   +-+   +-+   +-+   +-+ 
|i|   |D|   |D|   |i|   |i|   |D|   |i| 
+-+   +-+   +-+   +-+   +-+   +-+   +-+
       ^     ^                 ^
       |     |                 | 
       +-----+-----------------+---- dropped, contains no images
       
       
throughput: (limit 5)

+-+   +-+   +-+   +-+   +-+
|D|   |D|   |D|   | |   | |    3 dropped pages + 2 extra pages to fill up till the limit is reached, sort=-date
+-+   +-+   +-+   +-+   +-+

Now on an other page, say /news/ I want to paginate all other news items not containing the pages loaded on the home page.

---

I re-arranged a lot,

calling start=0 on all searches ( except the one I use pagination for )

it's solved.

Big thanks for stepping in Nik.

Edited by Martijn Geerts
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...