J3 Issue ?
avatar tonypartridge
tonypartridge
20 Sep 2018

so the Menu Items list, parent filter if you have a 3 tired menu i.e.

Services
-Home Improvements
--Bathrooms
--Lounge
-House Cleaning
--Carpets
--Dusting

If you filter by parent menu item 'Services' you do not get the sub items. i.e. bathrooms, lounge, carpets, dusting.

Before I do any work to improve this, is this as the majority would expect? Or would you expect to on show what is directly under the parent?

avatar tonypartridge tonypartridge - open - 20 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - change - 20 Sep 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Sep 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Sep 2018
Status New Information Required
avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Sep 2018
Category com_menus
avatar ReLater
ReLater - comment - 20 Sep 2018

Hard to say what's better. It depends on the number of sub item levels. The best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.

avatar brianteeman
brianteeman - comment - 20 Sep 2018

There is a use case for both options.
I am creating a dropdown menu structure -> I want to see all the level 1 menu items
I am working on one of those dropdowns and I want to see the parent and its children

The best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.

We dont have a way to select it :(

avatar tonypartridge
tonypartridge - comment - 20 Sep 2018

So there is a bug, the max levels should still be taking effect within the parent filter and it's not. (I always miss that option)

On Sep 20 2018, at 2:48 pm, Brian Teeman notifications@github.com wrote:

There is a use case for both options.
I am creating a dropdown menu structure -> I want to see all the level 1 menu items
I am working on one of those dropdowns and I want to see the parent and its children

The best solution for me would be if filter "Select Max Levels" would start at the level of the selected parent menu item.
We dont have a way to select it :(


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/1537451629.local-3b4b8401-aadb-v1.4.2-f587b7b7@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Fjoomla%2Fjoomla-cms%2Fissues%2F22271%23issuecomment-423189658&recipient=cmVwbHkrMDAxNTYwOTYwZTMwZWQ3ODk1OGQzMTBhYTkwMjVlOWNlNDY1YzJlZTlmOTM2ZGNlOTJjZjAwMDAwMDAxMTdiYjY3MjQ5MmExNjljZTE1OTU3ZWIyQHJlcGx5LmdpdGh1Yi5jb20%3D), or mute the thread (https://link.getmailspring.com/link/1537451629.local-3b4b8401-aadb-v1.4.2-f587b7b7@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABVglsBIPAkSNBmk7gXwwkmdghg3KoU2ks5uc5ylgaJpZM4Wx0kj&recipient=cmVwbHkrMDAxNTYwOTYwZTMwZWQ3ODk1OGQzMTBhYTkwMjVlOWNlNDY1YzJlZTlmOTM2ZGNlOTJjZjAwMDAwMDAxMTdiYjY3MjQ5MmExNjljZTE1OTU3ZWIyQHJlcGx5LmdpdGh1Yi5jb20%3D).

avatar brianteeman
brianteeman - comment - 20 Sep 2018

Sorry - I forgot there was a parent menu item select now

avatar ReLater
ReLater - comment - 20 Sep 2018

At the moment (3.9) it's like this: If a parent item is selected that is in level=1 or 2 and you set max. levels = 1 you get an empty list. I think also an empty list if you set it to 2. I'm too confused atm ;-)

avatar tonypartridge
tonypartridge - comment - 20 Sep 2018

I’ll see what I can do, I did add the parent filter after all. I just forgot about max levels ??

On Sep 20, 2018 at 5:23 pm, <ReLater (mailto:notifications@github.com)> wrote:

At the moment (3.9) it's like this: If a parent item is selected that is in level=1 or 2 and you set max. levels = 1 you get an empty list. I think also an empty list if you set it to 2. I'm too confused atm ;-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#22271 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABVglsSd4ySELzec1a2gHs_FtqBFnuAeks5uc8EQgaJpZM4Wx0kj).

avatar brianteeman brianteeman - change - 21 Sep 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 21 Sep 2018
avatar ggppdk
ggppdk - comment - 22 Sep 2018

If i understand the issue

we should have

Existing code

		// Filter the items over the parent id if set.
		$parentId = $this->getState('filter.parent_id');

		if (!empty($parentId))
		{
			$query->where('a.parent_id = ' . (int) $parentId);
		}

		// ...
		// ... this code will not change
		// ...

		// Filter on the level.
		if ($level = $this->getState('filter.level'))
		{
			$query->where('a.level <= ' . (int) $level);
		}

New code like:

		// Filter the items over the parent id if set.
		$parentId = $this->getState('filter.parent_id');

		if (!empty($parentId))
		{
			$level = $this->getState('filter.level');

			// Create a subquery for the sub-items list
			$subQuery = $db->getQuery(true)
				->select('sub.id')
				->from('#__menu as sub')
				->join('INNER', '#__menu as this ON sub.lft > this.lft AND sub.rgt < this.rgt')
				->where('this.id = ' . (int) $parentId);

			if ($level)
			{
				$subQuery->where('sub.level <= this.level + ' . (int) $level);
			}

			// Add the subquery to the main query
			$query->where('(a.parent_id = ' . (int) $parentId . ' OR a.parent_id IN (' . (string) $subQuery . '))');
		}

		// Filter on the level.
		elseif ($level = $this->getState('filter.level'))
		{
			$query->where('a.level <= ' . (int) $level);
		}
avatar ggppdk
ggppdk - comment - 22 Sep 2018

@tonypartridge

i have made a PR,
thanks for bringing this up,
current behavior is a limitation that makes menu-item management harder

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Sep 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-09-22 05:14:39
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2018
Closed_Date 2018-09-22 05:14:39 2018-09-22 05:14:40
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 22 Sep 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 22 Sep 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Sep 2018

closed as having Pull Request #22319

Add a Comment

Login with GitHub to post a comment