? Pending

User tests: Successful: Unsuccessful:

avatar fastslack
fastslack
29 Apr 2019

Pull Request for Issue # .

Summary of Changes

This patch use namespaces to load Joomla! libraries and accept multiple values as array for filtering.

Also add the option to set context value in the xml fields. For example:

        <field
                name="article"
                type="sql"
                label="COM_EXAMPLE_FORM_ARTICLE"
                sql_select="c.id, c.title"
                sql_from="#__content AS c"
                sql_order="c.id ASC"
                sql_filter="catid"
                key_field="id"
                value_field="title"
                context="com_example.list_view_example"
        />

Into the documentation for custom fields is well explained how to use default filters setting sql_default_{field} and a static value but is not explained how to set dynamic variables using user states for filtering. (see testing)

Testing Instructions

Using the last field example, we can see that we set sql_filter as catid . For filtering we must to set into our view.html.php file, using the setUserState method a value or an array for multiple values. For example:

$multiple_values = array(3, 5, 7); 
Factory::getApplication()->setUserState("com_example.list_view_example.filter.catid",  $multiple_values);

This is going to filter into the catid field using the values declared in the variable $multiple_values

Expected result

We should get the list filtered correctly using the static or dynamic values.

Documentation Changes Required

Dynamic filtering must to be added to:

https://docs.joomla.org/Special:MyLanguage/SQL_form_field_type

avatar fastslack fastslack - open - 29 Apr 2019
avatar fastslack fastslack - change - 29 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Apr 2019
Category Libraries
avatar HLeithner
HLeithner - comment - 29 Apr 2019

Looks like a new feature and have to go into j4, please rebase on j4-dev branch and create a new PR.

avatar HLeithner HLeithner - close - 29 Apr 2019
avatar HLeithner HLeithner - change - 29 Apr 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-04-29 13:24:49
Closed_By HLeithner
Labels Added: ?
avatar fastslack
fastslack - comment - 29 Apr 2019

Its a fix, not a new feature. Documentation is missing for actual code....

avatar alikon
alikon - comment - 29 Apr 2019

@fastslack is this related to #23568 and / or #22241

avatar fastslack
fastslack - comment - 30 Apr 2019

@alikon Yes Nicola! Related with both. Fix context is the key to solve this problem.

@HLeithner can you reopen please?

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Apr 2019
Status Closed New
Closed_Date 2019-04-29 13:24:49
Closed_By HLeithner
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Apr 2019
Status New Pending
avatar franz-wohlkoenig franz-wohlkoenig - reopen - 30 Apr 2019
avatar HLeithner
HLeithner - comment - 30 Apr 2019

I cleanup your PR a bit...

avatar fastslack fastslack - change - 1 May 2019
The description was changed
avatar fastslack fastslack - edited - 1 May 2019
avatar fastslack fastslack - change - 1 May 2019
The description was changed
avatar fastslack fastslack - edited - 1 May 2019
avatar Quy
Quy - comment - 2 May 2019

Should namespaces be in a separate PR for J4 and focus on multiple filters values only in this PR for J3?

avatar fastslack
fastslack - comment - 4 May 2019

Should I? I can make a separate PR but I think tjhat Joomla! 3.9 use namespaces too

avatar Quy
Quy - comment - 4 May 2019

Preferably one PR per issue to keep it simple for testing.

avatar fastslack fastslack - change - 8 May 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-05-08 07:37:34
Closed_By fastslack
avatar fastslack fastslack - close - 8 May 2019
avatar hakanara
hakanara - comment - 15 Jun 2019

Dear all,

I really appreciate the efforts you put into fixing the dynamic filtering feature of SQL field. But, there is still no documentation update for this feature in Joomla docs. I read the explanations here to apply and use this feature but view.html.php file does not exist for Joomla menu settings or for a plugin. So how or where can I use this feature? Does it really work?

So please, either update the documentation or please check if this feature works in a plugin or in Joomla menu settings.

I can open a new issue if required.

Kind regards

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Jun 2019

@hakanara yes, please open a new Issue and link also to this Pull Request, thanks.

avatar Quy
Quy - comment - 15 Jun 2019

Reopened #22241

Add a Comment

Login with GitHub to post a comment