Skip to content

Conversation

@pe7er
Copy link
Contributor

@pe7er pe7er commented Aug 16, 2015

This PR moves the Filter fields from the left Sidebar to Search Tools in the middle column.

Testing instructions

Before PR: Extensions > Templates > Styles

The left Sidebar has 2 filter options: Select Template & Select Location ("site/administrator")

template_styles_before

After PR: Extensions > Templates > Styles

The 2 filter options have been moved to Search Tools
and I have changed their order:
Select Location ("site/administrator") & Select Template
Note: the listed Templates are not yet dependent on "Location".

template_styles_after

Before PR: Extensions > Templates > Templates

The left Sidebar has 1 filter option: Select Location ("site/administrator")

template_templates_before

After PR: Extensions > Templates > Templates

The filter option Select Location ("site/administrator") has been moved to Search Tools,
and a List Limit dropdown box has been added.

template_templates_after

@pe7er
Copy link
Contributor Author

pe7er commented Aug 16, 2015

There's a small issue with this PR: The Template filter does not take into account the Location filter.
If you go to Extensions > Templates > Styles, select "Select Location" (to select admin or site templates) then the "Select Template" will still show all (admin + site) templates.

I did not know how to pass the selected client_id into the $options = TemplatesHelper::getTemplateOptions(); function

https://github.com/pe7er/joomla-cms/blob/search-tools-filters-templates/administrator/components/com_templates/models/fields/templatename.php

@hitchblade
Copy link

Works great and looks good!


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

@watchfulli-dev
Copy link

@test success, after applying the patch, the filters from the right side now appear on top under "Search tools", filters also tested and applying filters works as expected.


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

@zero-24
Copy link
Contributor

zero-24 commented Aug 23, 2015

RTC based on tests. Thanks @watchfulli-dev and @hitchblade as well as @pe7er


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 23, 2015
@infograf768
Copy link
Member

I still see a small issue:
When selecting a location the "Select Template" dropdown still lists both site AND admin templates

@zero-24 zero-24 modified the milestone: Joomla! 3.5.0 Aug 25, 2015
@pe7er
Copy link
Contributor Author

pe7er commented Aug 26, 2015

I am able to reproduce the issue that @infograf768 reported:

In the old situation the options under "Select Template" filter are dependent on the "Select Location" filer. When you select "Site", it only displays the site templates Beez3 + protostar.
template-styles-before

This PR moves the filters to the top. However, the "Select Template" filter is no longer dependent on the "Select Location" filer. When you select "Site", it displays the site templates Beez3 + protostar, but also the admin template Isis + Hathor.
template-styles-after

I'll try to find a solution for that.
Thanks @infograf768 !

@zero-24
Copy link
Contributor

zero-24 commented Aug 26, 2015

back to pending 😄


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

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 26, 2015
@pe7er
Copy link
Contributor Author

pe7er commented Aug 26, 2015

I solved it by adding a check for client_id filter. That client_id value is passed to the helper file.

/administrator/components/com_templates/models/fields/templatename.php
$clientId = JModelList::getUserStateFromRequest('.filter.client_id', 'filter_client_id', null);
$options = TemplatesHelper::getTemplateOptions($clientId);

Can someone please double check if this is a correct solution?

@RemcoJanssen
Copy link

I have tested this item ✅ successfully on 175546b

Works like a charm!


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

@n9iels
Copy link
Contributor

n9iels commented Oct 12, 2015

@test The following error showed up at the styles view when expend the search tools:
Deprecated: Non-static method JModelList::getUserStateFromRequest() should not be called statically, assuming $this from incompatible context in C:\MAMP\htdocs\joomla-cms\administrator\components\com_templates\models\fields\templatename.php on line 40

@pe7er
Copy link
Contributor Author

pe7er commented Oct 12, 2015

Thanks for tesing @RemcoJanssen & @n9iels.

I've to dig into the deprecated error later. Travis did not complain about that ;-)
What PHP version do you use Niels?

@n9iels
Copy link
Contributor

n9iels commented Oct 12, 2015

PHP 5.6.3, with error_reporting = E_ALL set in php.ini and the error reporting parameter in global configuration is set on: development

Deprecated: Non-static method JModelList::getUserStateFromRequest() should not be called statically reported by n9iels
#7701 (comment)
@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @hitchblade, @RemcoJanssen, @watchfulli-dev


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

@pe7er
Copy link
Contributor Author

pe7er commented Oct 13, 2015

Thanks @n9iels! I was able to reproduce the error and corrected it in my PR.

@n9iels
Copy link
Contributor

n9iels commented Oct 13, 2015

@test problem solved. Tested successful :)

@pe7er
Copy link
Contributor Author

pe7er commented Oct 13, 2015

wow, you are fast! Thanks @n9iels

@a1d3s
Copy link

a1d3s commented Oct 24, 2015

works

@a1d3s
Copy link

a1d3s commented Oct 24, 2015

I have tested this item ✅ successfully on 08def4c

works good


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

@sriva113
Copy link

Successfully tested


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

@sriva113
Copy link

Filtering still doesn't work


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

@wombel2000
Copy link

If you select "selected Template" you can't see the admin Tenplate
as you schould.


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

@wombel2000
Copy link

Picture to the previous coment!screen shot 2015-10-24 at 05 22 40


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

@jduerscheid
Copy link

I have tested this item 🔴 unsuccessfully on 08def4c

@pe7er: Test unsucessfully, there is an error in the search tool, area Select Template, I miss the admin templates.


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

@jduerscheid
Copy link

Screenshot to previous post

screen shot 2015-10-24 at 07 36 38


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

@yvesh
Copy link
Member

yvesh commented Oct 24, 2015

Yes, like @jduerscheid said the admin templates are missing. (Joomla 3.5.6-dev)


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

@yvesh
Copy link
Member

yvesh commented Oct 24, 2015

I have tested this item 🔴 unsuccessfully on 08def4c


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

@pe7er
Copy link
Contributor Author

pe7er commented Nov 4, 2015

I've updated this PR with staging but could not solve the reported issue.

I was able to reproduce the error with
Extensions > Templates > Styles > Filter on "Location = Administrator",
"Select Templates" won't show Admin templates, only Site templates.

I have an issue with this part in /administrator/components/com_templates/models/fields/templatename.php
$app = JFactory::getApplication();
$clientId = $app->getUserStateFromRequest('.filter.client_id', 'filter_client_id', null);
$options = TemplatesHelper::getTemplateOptions($clientId);

I am not able to retrieve the $clientId that needs to be passed to the getTemplateOptions.
0 = Site, 1= Admin, but $clientId is always totally empty.
I hope that someone spots the cause of the issue....

@pe7er pe7er closed this Nov 4, 2015
@pe7er pe7er reopened this Nov 4, 2015
@pe7er
Copy link
Contributor Author

pe7er commented Nov 4, 2015

Sorry, I pressed the wrong button (Close and comment) so I had to reopen it..

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @a1d3s, @hitchblade, @jduerscheid, @n9iels, @RemcoJanssen, @watchfulli-dev, @yvesh


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

@pe7er
Copy link
Contributor Author

pe7er commented Nov 4, 2015

I've corrected the "Location = Administrator" -> "Templates" dropdown did not show Admin templates issue with help from @roland-d. Thanks Roland!

@zero-24
Copy link
Contributor

zero-24 commented Nov 4, 2015

I have tested this item ✅ successfully on ecdcf0c

Works now. Thanks @pe7er


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

@Kubik-Rubik
Copy link
Member

I have tested this item ✅ successfully on ecdcf0c

Works as described! -> RTC

Thank you @pe7er!


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

@Kubik-Rubik Kubik-Rubik added the RTC This Pull Request is Ready To Commit label Nov 4, 2015
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 4, 2015
@Kubik-Rubik Kubik-Rubik added the RTC This Pull Request is Ready To Commit label Nov 4, 2015
@roland-d roland-d closed this in 3654f36 Nov 4, 2015
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 4, 2015
@pe7er pe7er deleted the search-tools-filters-templates branch November 5, 2015 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.