Soma Posted April 6, 2013 Share Posted April 6, 2013 When I have a selector with a parent.field all other fields get ignored: title|body|parent.title%=keyword Doesn't return result that would be found in title or body anymore. Is this a limitation for the parent field? Link to comment Share on other sites More sharing options...
ryan Posted April 7, 2013 Share Posted April 7, 2013 I tried to reproduce that here, but it seems to be returning the expected result for me: $items = $pages->find("title|body|parent.title%=France"); Here's the results I got. The "title" matches the first item, and "parent.title" matches the rest of the items (which don't include "France" in any of their fields). They all have a blank 'body' field. /regions/europe/france/ /regions/europe/france/arles/ /regions/europe/france/avignon/ /regions/europe/france/beaune/ /regions/europe/france/blaye/ /regions/europe/france/bordeaux/ /regions/europe/france/cadillac/ /regions/europe/france/chalon/ /regions/europe/france/conflans/ /regions/europe/france/giverny/ /regions/europe/france/les-andelys/ /regions/europe/france/lyon/ /regions/europe/france/normandy-beaches/ /regions/europe/france/paris/ /regions/europe/france/pauillac/ /regions/europe/france/rouen/ /regions/europe/france/saint-emilion/ /regions/europe/france/strasbourg/ /regions/europe/france/tournon/ /regions/europe/france/vernon/ /regions/europe/france/vienne/ /regions/europe/france/viviers/ Link to comment Share on other sites More sharing options...
Soma Posted April 7, 2013 Author Share Posted April 7, 2013 Is that test with multilanguage fields? I can't get it to work, even when I tried from a template. The module I tried to get it to work is ImageManager, but I did remove the parent.title at the end since it's also not really needed. Link to comment Share on other sites More sharing options...
ryan Posted April 9, 2013 Share Posted April 9, 2013 Is that test with multilanguage fields? Yes, my title and body fields were multi-language. Though I only had the default (en) language populated. To duplicate the issue, would I populate the title in some other language, make that my $user language, and then perform the search? Just want to make sure I understand the all the factors necessary to reproduce. Link to comment Share on other sites More sharing options...
Soma Posted April 9, 2013 Author Share Posted April 9, 2013 I tested again in different installs a little after your post and it partly works, but when using parent.title in the fields title|parent.title%=space I get the space parent and all it's children ... but NOT other pages outside that parent that have space in it's title. Hope that makes it clear. It's like AND and not OR. Link to comment Share on other sites More sharing options...
ryan Posted April 11, 2013 Share Posted April 11, 2013 I'm wasn't seeing that behavior here the other day, as several other pages matched when I tested, but I only copied/pasted enough in here to communicate. I need to go back and test again when in a non-default language. Just to confirm, this is occurring in a non default language? Link to comment Share on other sites More sharing options...
Soma Posted April 16, 2013 Author Share Posted April 16, 2013 Hey Ryan, I tested again on different installs and I'm still getting strange results. $pages->find('title|parent.title%=space'); In my language enabled install I get something like the following, no matter what user language is set to. Although it should return other pages that also have "space" in their title, it doesn't return them in the result. Title: Space | Parent: ImagesTitle: hubble-wallpaper-space | Parent: SpaceTitle: hubble-wallpaper-space-647500_1600_1200 | Parent: SpaceTitle: outer-space-stars | Parent: SpaceTitle: space-space-584336 | Parent: SpaceTitle: pastedgraphic-2 | Parent: SpaceTitle: pastedgraphic-3 | Parent: SpaceTitle: 492772525_d8803eb637_o | Parent: SpaceTitle: 2400862255_daeb5326d8 | Parent: SpaceTitle: pwprofile_ch-uploads-4 | Parent: SpaceTitle: pwprofile_ch-uploads2-4 | Parent: SpaceTitle: pwprofile_ch-uploads-4 | Parent: SpaceTitle: pwprofile_ch-uploads2-4 | Parent: SpaceTitle: pwprofile_ch-uploads-4 | Parent: SpaceTitle: pwprofile_ch-uploads2-4 | Parent: Space... Notice the first has parent "Images". Which is strange as there's also "space" in titles under "Nature" parent!When I remove the parent.title from the selector I get this: Title: Space | Parent: ImagesTitle: hubble-wallpaper-space | Parent: SpaceTitle: hubble-wallpaper-space-647500_1600_1200 | Parent: SpaceTitle: outer-space-stars | Parent: SpaceTitle: space-space-584336 | Parent: SpaceTitle: space | Parent: NatureTitle: space | Parent: NatureTitle: space | Parent: Nature In my other install with different pages but same selector, where I don't have language support installed: Title: Templates space | Parent: HomeTitle: asdasd§ | Parent: Templates spaceTitle: sdf sfs f | Parent: Templates spaceTitle: gsgfdsf | Parent: Templates spaceTitle: fgfdsgsa as | Parent: Templates spaceTitle: Space | Parent: ImagesTitle: space-space | Parent: Space It finds all that it should with "space" either in title or parent title. Link to comment Share on other sites More sharing options...
ryan Posted April 18, 2013 Share Posted April 18, 2013 Soma, while I wasn't able to duplicate that here, I was able to find a bug when using just parent.title, so I'm wondering if it might also be responsible for the result you were getting. Can you try the latest dev branch and let me know if you are still experiencing the error? 1 Link to comment Share on other sites More sharing options...
Soma Posted April 18, 2013 Author Share Posted April 18, 2013 Scary that you can't reproduce this... Well, I just tested with latest version and now it seems to work as it should! The result of the previous test first example is now like this: Title: Space | Parent: ImagesTitle: hubble-wallpaper-space | Parent: SpaceTitle: hubble-wallpaper-space-647500_1600_1200 | Parent: SpaceTitle: outer-space-stars | Parent: SpaceTitle: space-space-584336 | Parent: SpaceTitle: 1920x1080-wallpapers-of-nature-1249994468-1 space | Parent: NatureTitle: nature_444_photos space | Parent: NatureTitle: serena space | Parent: NatureTitle: | Parent: SpaceTitle: | Parent: SpaceTitle: | Parent: SpaceTitle: | Parent: Space ... So the pages with a "Nature" parent are showing now. So definately you fixed something that was causing this. 1 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