Skip to content

Conversation

@pe7er
Copy link
Contributor

@pe7er pe7er commented Apr 21, 2019

Pull Request to add a Component filter to the "Menus: Items" overview.
It's PR #23566 re-done for Joomla 4.

Summary of Changes

This PR adds a Component filter to the menu items overview so that you can filter on specific Components.
Before Patch

menu-component-filter-before

Testing Instructions

  • Install the PR.
  • Open the Menus: All Menu Items page (Menus > All Menu Items)
  • Create a menu item of type Contact - Single Contact
  • Click on "Search Tools",
  • Select a component (e.g. Contacts)

Expected result

The list of menu items should be filtered to only show menu items to views of that selected Component.

menu-component-filter-after

@richard67
Copy link
Member

I have tested this item ✅ successfully on ac6b7ec


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@pe7er
Copy link
Contributor Author

pe7er commented Apr 21, 2019

btw: @Tchangue created a similar PR: [4.0] Implementation of feature 'filter menu items by component' #21358

@ghost
Copy link

ghost commented Apr 21, 2019

@pe7er closing #21358?

@brianteeman
Copy link
Contributor

Yes close #21358 as it has clearly been abandoned

@richard67
Copy link
Member

I have tested this item ✅ successfully on 43bb5c1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@infograf768
Copy link
Member

COM_MENUS_FILTER_COMPONENT_LABEL ini string missing.

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on f57ee0e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@brianteeman
Copy link
Contributor

COM_MENUS_FILTER_COMPONENT_LABEL ini string missing.

No it's not - the string didn't need to be added to this PR as it already existed.

image

@richard67
Copy link
Member

Hmm, I can't find the string "COM_MENUS_FILTER_COMPONENT_LABEL" in any language file.

When searching for "- Select Component -", I find:

administrator\language\en-GB\en-GB.com_menus.ini:COM_MENUS_OPTION_SELECT_COMPONENT="- Select Component -"
administrator\language\en-GB\en-GB.com_users.ini:COM_USERS_OPTION_SELECT_COMPONENT="- Select Component -"

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on f57ee0e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@brianteeman
Copy link
Contributor

oops - my apologies. The label is indeed missing. I need more coffee

@richard67
Copy link
Member

Same for me, more coffee ;-)

@richard67
Copy link
Member

But why did everything look ok then when teesting it?

@richard67
Copy link
Member

I have not tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@brianteeman
Copy link
Contributor

@richard67 View the source. The label is only visible for screen readers

@richard67
Copy link
Member

@brianteeman And what would be the right change? Add the missing text "COM_MENUS_FILTER_COMPONENT_LABEL" to the language file? Or use another already existing text with the same content, i.e. "COM_MENUS_OPTION_SELECT_COMPONENT"?

@infograf768
Copy link
Member

infograf768 commented Apr 22, 2019

just compare with the other similar filters label in the ini file, i.e value should be “Component” if I do not mistake.

@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Apr 23, 2019
@pe7er
Copy link
Contributor Author

pe7er commented Apr 23, 2019

I've made the suggested corrections.
Thank you all for the corrections and for testing!

@roland-d roland-d removed the RTC This Pull Request is Ready To Commit label May 19, 2019
@roland-d
Copy link
Contributor

@pe7er I have removed the RTC because I am failing to make this work.

The component filter works fine for me on the All Menu Items but when I go to the Main menu, the filter won't be applied nor will it stick as selected.

This works:
image

This does not work:
image

As you can see my selection is not there.

Another issue is, when I do select a filter on the All Menu Items and I go to Main Menu, the filter cannot be reset. The screen will be stuck to this:
image

Finally, I am missing this code in the populateState function:

$componentName = $this->getUserStateFromRequest($this->context . '.filter.componentName', 'filter_componentName');
		$this->setState('filter.componentName', $componentName);

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 19, 2019
@ghost
Copy link

ghost commented May 19, 2019

@roland-d RTC is set.

@roland-d
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on bb364f8

The filter is not working on all pages. See my comment.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@roland-d roland-d removed the RTC This Pull Request is Ready To Commit label May 19, 2019
@infograf768
Copy link
Member

Testing now

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 19, 2019
@roland-d
Copy link
Contributor

@franz-wohlkoenig It was the bot, I now marked my test as unsuccessful, hopefully that will stop it :)

@roland-d
Copy link
Contributor

roland-d commented May 19, 2019

I am powerless to the bot 😄

Although it should not mark it RTC when there is a failed test.

@infograf768
Copy link
Member

Agree with @roland-d findings. Same errors here.

@alikon
Copy link
Contributor

alikon commented May 19, 2019

back to pending


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 19, 2019
@brianteeman
Copy link
Contributor

@roland-d I haven't tested it as I am still traveling but won't namespacing the XML type cause issues with the way that custom elements are used?

@roland-d
Copy link
Contributor

It is not about the file itself but just the field name. Perhaps I should have used the word camel case instead of namespace as that seems to be a loaded word 😜

@Quy Quy added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Jul 4, 2019
@uthorat
Copy link

uthorat commented Oct 19, 2019

I have tested this item ✅ successfully on bb364f8

Able to select the menu from all menu & main menu section as per component selection Also able to reset the filters.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@Neppert
Copy link

Neppert commented Oct 19, 2019

I have tested this item 🔴 unsuccessfully on bb364f8

The result was not quite negative, because in the test installation on joomlapbf.com no component was found connected to the menu data - so there could not be displayed a data list of components to filter. I just saw a void input field.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@deepa-g
Copy link

deepa-g commented Oct 19, 2019

I have tested this item 🔴 unsuccessfully on bb364f8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@nadjak77
Copy link
Contributor

I have tested this item ✅ successfully on bb364f8

works like subscriped


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@neotrendch
Copy link

I have tested this item 🔴 unsuccessfully on bb364f8

tested unsuccessfully, 5th field is not a dropdown, but a text input field


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@adiheutschi
Copy link

I have tested this item 🔴 unsuccessfully on bb364f8

For me, only a text box appears

Printscreen

Printscreen

Setting Value
PHP Built On Linux server2.adiheutschi.ch 3.10.0-962.3.2.lve1.5.24.9.el7.x86_64 #1 SMP Wed Feb 13 08:24:50 EST 2019 x86_64
Database Type mysql
Database Version 10.2.27-MariaDB
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.3.10
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 4.0.0-beta1-dev Development [ Amani ] 17-October-2019 20:21 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@idefax
Copy link

idefax commented Oct 19, 2019

I have tested this item 🔴 unsuccessfully on bb364f8

It does not work. It adds a textfield with no value instead of a dropdown.

Screenshot

PHP Version 7.3.8
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 4.0.0-beta1-dev Development [ Amani ] 17-October-2019 20:21 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24665.

@berndkohlen
Copy link

Does not work with "Contacts". Needs the component name "com_contact".
grafik

@pe7er
Copy link
Contributor Author

pe7er commented Apr 27, 2020

Thank you all for testing & your suggestions for improvements!

As I did not have the branch for this PR in my local git repo (hence it says "from unknown repository"),
I redid the PR with the suggested improvements.

New PR: #28832

I'm closing this one...

@pe7er pe7er closed this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators Updates Requested Indicates that this pull request needs an update from the author and should not be tested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.