Soma Posted August 26, 2013 Share Posted August 26, 2013 I found a nasty bug when moving pages in the page tree in the admin. I have a setup where I have created a new category page and moved all the product pages on the same level into the newly created category. But then the find() I used to get all products from a parent above the category page fails. The product pages have children, which seems to be the key to reproduce this. I also have multilanguage installed but I don't think that does anything. I tried and was abel to reproduce this in my local test install with complete unreleated templates or fields. This is the on second level ... /shop/ /category1/ /newparentpage/ /product1/ (product template) /product-var1/ /product2/ (product template) /product-var1/ When I move "product1" and "product2" inside the "newparentpage" /shop/ /category1/ /newparentpage/ /product1/ /product2/ I can't use following to get all products under "category1" $pages->find("has_parent=category1, template=product"); // returns nothing $pages->get("/shop/category1/")->find("template=product"); // returns nothing $pages->find("has_parent=category1_ID, template=product, include=all"); // returns nothing This got me, as I never experiences something like this. The page tree works and also finding the product with $pages->find("template=product"); // will find all still Also this doesn't happen if the moved product pages have no children. So there's something wrong with the page_parents table I guess, but haven't investigated futher as I'm in a hurry to finish the website. And always then such things happens. 4 Link to comment Share on other sites More sharing options...
ryan Posted August 27, 2013 Share Posted August 27, 2013 Thanks Soma, I was able to reproduce it here too. Can you try out the fix I posted to the dev branch? You'll have to undo the page move you did before, and move it back again in order to get it to rebuild its index. 6 Link to comment Share on other sites More sharing options...
Soma Posted August 27, 2013 Author Share Posted August 27, 2013 Your welcome, thanks for the quick fix it works now! 1 Link to comment Share on other sites More sharing options...
ceberlin Posted August 27, 2013 Share Posted August 27, 2013 Whow, that could really explain nearly all the trouble I had with find() in the past (where the source tree worked with find and the cloned trees worked not). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now