1

I'm on EE2.5.3 using playa 4.3.3 and matrix 2.5.3 with the code below. My understanding is the children tag should take into consideration the status of the parent and not return children for a closed parent entry. However, I'm getting exactly that. The tag is returning children for parents with a closed status. I've checked to make sure the parent status is closed, entry date is in the past.

Is this a bug or a problem with my code?

    {exp:playa:children col="warranty_item_subscontractor" dynamic="no" orderby="title" sort="asc"} 
         <li>{title} &rarr; {exp:playa:total_parents} warranty {if {exp:playa:total_parents} == 1}item{if:else}items{/if}</li>
    {if no_results}<li>There are no outstanding subcontractor items</li>{/if} 
    {/exp:playa:children}

Here's some of the output. Both ASD Systems and Beverly Northwest are children whose parent entry is closed and shouldn't be returned.

ACCENTS & INTERIORS, INC. → 8 warranty items

AMERICA 1ST ROOFING → 2 warranty items

ASD SYSTEMS, INC. → 0 warranty items

BEVERLY NORTHWEST, INC. → 0 warranty items

4
  • Hey Stephen - how is Matrix playing into this, if at all? I want to test it but need to make sure I understand your setup first. Also, if you just output the parent and use {status} to echo out its status, what do it report? I just want to make sure that you're seeing what EE is seeing. Thanks!
    – Lisa
    Jan 24 '13 at 18:25
  • The playa field is in a matrix. col="warranty_item_subscontractor" is the matrix column that contains the playa field where the parent/child relationship is made.
    – Stephen
    Jan 24 '13 at 18:27
  • I output the parents using a channel entries tag and it displayed the parents correctly, only open status (I didn't use a status parameter). The parent for ASD Systems, Inc is indeed closed, and the channel entries tag did not return it. Whereas, the playa children tag did return the child for the closed parent.
    – Stephen
    Jan 24 '13 at 18:36
  • I see the same behavior in my test environment - I have emailed my team to confirm the expected behavior here. :) Thank you Stephen!
    – Lisa
    Jan 24 '13 at 18:36
1

Adding a conditional for total_parents gets the results I need. However, I'd love it if the children tag honored the parent status.

        {exp:playa:children col="warranty_item_subscontractor" orderby="title" sort="asc"}
    {if {exp:playa:total_parents} >= 1}
             <li>{title} &rarr; {exp:playa:total_parents} warranty {if {exp:playa:total_parents} == 1}item{if:else}items{/if}</li>
             {/if}
        {if no_results}<li>There are no outstanding subcontractor items</li>{/if} 
    {/exp:playa:children}
0

The "status" on the children tag says "only show children whose status is 'Open'". It doesn't apply to the parent.

You might be able to pull it off with a nested:

{exp:playa:parents entry_id="{entry_id}" status="Open"}

inside the children tag.

7
  • Brad, yeah, those status params I added were an attempt to get it to work. I realize they only apply to the child. According to everything I've researched the children tag should honor the status of the parent. It seems like it would be the case since my output shows there is a parent, but the total_parent tag says zero. So, it's similtaneously saying there is a parent, but there isn't a parent.
    – Stephen
    Jan 24 '13 at 20:18
  • I don't follow "my output shows there is a parent, but the total_parent tag says zero". The titles you are outputting are the titles of the children. If you want to show "children whose parents are open" easily, we'd need to add some sort of parent:status="Open" support.
    – Brad Bell
    Jan 24 '13 at 20:36
  • Yes, those are children titles. In order for a children title to display, a parent must exist. So ASD Systems is a child with a parent. There's a child parent relationship. However, the total_parents tag is returning 0. This means there is no parent for ASD Systems. This begs the question, which tag is correct? The total_parents tag is honoring the status whereas the children tag is not. Indeed when I check the status of the parent it is closed. (continues)
    – Stephen
    Jan 24 '13 at 20:49
  • So, the child tag is returning the title despite the parent being closed, and the total_parents tag is returning zero because it's taking into consideration the status of the parent. To test this, I change the parent status to open, then the total_parents tag returns 1. So it appears to be a bug in the children tag. I've scoured this site and get satisfaction, while there's no exact question like mine, Brandon has stated the children tag should honor the parent status. It's just not doing it.
    – Stephen
    Jan 24 '13 at 20:49
  • Technically, both tags are correct because "status" on the children tag only applies to the children. :) Just to be sure, I asked Brandon and he confirmed it. Do you have a link to where he stated otherwise?
    – Brad Bell
    Jan 24 '13 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.