Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[com_modules] Add page (menuitem) filter #9987

Merged

Conversation

andrepereiradasilva
Copy link
Contributor

@andrepereiradasilva andrepereiradasilva commented Apr 19, 2016

Pull Request for Improvement.

Summary of Changes

One filter, IMO, is missing in com_modules: the page filter.
I think this filter is very handy since it can show all modules for a particular menu item.

image

Testing Instructions

  1. Apply patch
  2. Go to Extensions -> Modules
  3. Create custom modules witl "All", "No pages", "All except selected" and "Only selected" menu assigments
  4. Now test the new filter
  5. Test also the filter when adding "+Module" in articles
    • in backend the filter should appear
    • in frontend the filter shouldn't appear

Note: The filter query needs to be tested in postgresql too (it's a query with several subqueries).

Observations

There actually an inconsistency in admin modules list: the "Pages" column exist and shouldn't.
Note that inconsistency already exists because the column is already there.

So i guess a PR to correct that should also remove this filter from the admin modules list.

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-staging labels Apr 19, 2016
@@ -124,6 +124,7 @@ COM_MODULES_OPTION_POSITION_TEMPLATE_DEFINED="Template"
COM_MODULES_OPTION_POSITION_USER_DEFINED="User"
COM_MODULES_OPTION_SELECT_CLIENT="- Select Type -"
COM_MODULES_OPTION_SELECT_MODULE="- Select Type -"
COM_MODULES_OPTION_SELECT_PAGE="- Select Page -"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check but dont we usually say Menu Item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but in this case the column name is "Pages" that's why i used this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blast this is tricky. The title of the option is Menu Assignment and then the values are all Page xxx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - confusing indeed - I am happy to go with your suggestion for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so it can be tested as it is

@brianteeman
Copy link
Contributor

Just as with position it is possible to set pages to ::none::
So there needs to be a way to select ::none:: from the filter


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

@andrepereiradasilva
Copy link
Contributor Author

andrepereiradasilva commented Apr 19, 2016

ok, you're right, makes sense. will check that.

@andrepereiradasilva
Copy link
Contributor Author

ok done. We have an option to select the modules not assigned to any pages now too.

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on fe3b973

All good.

Just think it would be better if instead of "No pages" it would be the same as with positions and be ":: None ::"


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

@andrepereiradasilva
Copy link
Contributor Author

Just think it would be better if instead of "No pages" it would be the same as with positions and be ":: None ::"

IMO that could be confusing. Because that is a term used in the positions.

We could use "None" (instead of "No pages") like in the column when you have a module not assigned to any menu if you prefer. Please tell me what you prefer, i can easily chnage it.

@brianteeman
Copy link
Contributor

I will leave it to someone else to decide which option


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

@andrepereiradasilva
Copy link
Contributor Author

@brianteeman BTW did you test on postgresql ?

@brianteeman
Copy link
Contributor

Not yet - i forgot - testing that for you now

@brianteeman
Copy link
Contributor

As far as I can see it works well in postgres

@MDXBilal12
Copy link

I have tested this item ✅ successfully on fe3b973

All good.

Just think it would be better if instead of "No pages" it would be the same as with positions and be ":: None ::"


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

@MDXBilal12
Copy link

All good.

Just think it would be better if instead of "No pages" it would be the same as with positions and be ":: None ::"


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

@brianteeman
Copy link
Contributor

@andrepereiradasilva if you make the change to ::none:: I will set this RTC


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

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @brianteeman, @MDXBilal12


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

@andrepereiradasilva
Copy link
Contributor Author

@brianteeman done. See 28183f5

@brianteeman
Copy link
Contributor

Not at my desk but looking at the code doesn't that produce ::::none::::
On 20 Apr 2016 12:36 pm, "andrepereiradasilva" notifications@github.com
wrote:

@brianteeman https://github.com/brianteeman done. See 28183f5
28183f5


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9987 (comment)

@andrepereiradasilva
Copy link
Contributor Author

look again

image

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 28183f5


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

@brianteeman
Copy link
Contributor

As I said I was checking from my phone ;) All good


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

@brianteeman
Copy link
Contributor

Setting RTC as the only change since the last tests was a language string


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 20, 2016
@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 7e37a19


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

@brianteeman
Copy link
Contributor

RTC - cool new feature


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 24, 2016
// If user selected the modules not assigned to any page (menu item).
if ((int) $menuItemId === -1)
{
$query->having('MIN(mm.menuid) IS NULL');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mm.menuid should be enclosed in a quoteName statement.

@roland-d
Copy link
Contributor

Taking off RTC for now until code fixes are implemented.


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

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 24, 2016
@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @brianteeman, @grhcj, @MDXBilal12


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

@andrepereiradasilva
Copy link
Contributor Author

done @roland-d

@andrepereiradasilva
Copy link
Contributor Author

@roland-d can we have the RTc back on this one. Only did the changes you requested.

@roland-d
Copy link
Contributor

@andrepereiradasilva I am having a conflict:

error: patch failed: layouts/joomla/searchtools/default/filters.php:11
error: layouts/joomla/searchtools/default/filters.php: patch does not apply

Would you mind checking if there is a conflict with current staging?

@andrepereiradasilva
Copy link
Contributor Author

strange let me update the branch

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @brianteeman, @grhcj, @MDXBilal12


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

@andrepereiradasilva
Copy link
Contributor Author

ok @roland-d try now.

@roland-d
Copy link
Contributor

@andrepereiradasilva The fatal error is gone but I have a whitespace error now :)

<stdin>:108: trailing whitespace.
                                        (' . $subQuery1 . ') = 0
warning: 1 line adds whitespace errors.

In addition I have a failure in my test, see this screenshot:
image

The menu is called About Joomla and I think we should keep the same name rather than an internal name. What do you think?

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @brianteeman, @grhcj, @MDXBilal12


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

@andrepereiradasilva
Copy link
Contributor Author

you're more efficient than travis! whitespace removed

@andrepereiradasilva
Copy link
Contributor Author

@roland-d

The menu is called About Joomla and I think we should keep the same name rather than an internal name. What do you think?

I think so. But thats's all across joomla menu field selector (in all views that use it).
Nothing to do with my PR. That is for another PR.

@andrepereiradasilva
Copy link
Contributor Author

I will make a PR to change that in all menu select fields

@andrepereiradasilva
Copy link
Contributor Author

@roland-d new PR for that #10625 please test

@brianteeman
Copy link
Contributor

brianteeman commented May 25, 2016 via email

@Bakual
Copy link
Contributor

Bakual commented May 25, 2016

This should be tested in other databases than MySQL (PostgreSQL or MSSQL). Because we may have to add more fields to the select statement due to the added having clause.
MySQL allows to do stuff here which PostgreSQL doesn't allow.

@roland-d roland-d merged commit 5e52989 into joomla:staging May 25, 2016
@roland-d
Copy link
Contributor

Thanks everybody

@andrepereiradasilva andrepereiradasilva deleted the com_modules-menuitem-filter branch May 25, 2016 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants