Skip to content

Using parent channel in the {siblings} tag to filter results produces no output #184

@svedish

Description

@svedish

Description of the problem

When using the channel parameter the {siblings} tag doesn't output anything if the specified channel is a parent channel. I would expect to be able to use a parent channel to filter entries, which is crucial, for example, if the same field is used in multiple parents channels.

In my example, I imagined a school where students belong to both classes and football teams. The members of each class don't necessarily coincide with the members of each team, although both classes and teams have members from the same students pool.
Therefore I created 3 channels (classes, teams and students) and used just one relationship field (members) to link classes and teams to the same students channel.

How To Reproduce

  1. Start from a fresh installation and name the website (v.5.2.2).

  2. Create the following channels structure:



Classes
  title       Text Input
  url_title   Text Input
  members     Relationship (pointing to Students channel, multiple Students)	

Teams
  title       Text Input
  url_title   Text Input
  members     Relationship (pointing to Students channel, multiple Students)	

Students
  title       Text Input
  url_title   Text Input
  name        Text Input

  1. Create several students (Robert, Nick, Jack, John, Mark, Tom), 1 class (with members Jack, John, Mark, Robert) and 1 team (with members Nick, Robert, Tom).

  2. Create a template group called siblings and in the index page use the following code (you can use the teams or classes channel to filter, the result is the same):


	{exp:channel:entries channel="students" url_title="robert"}

	{siblings channel="teams" field="members" backspace="6"}
	{siblings:name}
{/siblings} {/exp:channel:entries}
  1. Load the siblings template. The code will output nothing.

  2. If you filter only by the members field everything works (the output is Jack Nick John Tom Mark ), but you get Robert's siblings from both his class and team, which is not what I am trying to achieve.

Error Messages

No error messages: simply the siblings tag prints nothing.

Screenshots / Videos / Template Code
N/A

Environment Details:

  • Version: 5.2.2
  • PHP Version 7.2.12
  • MySQL Version 5.6.39-83.1
  • OS: Linux
  • Web Server: Apache 2.2.34

Possible Solution
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions