?
avatar dkanchev
dkanchev
17 Oct 2014

Steps to reproduce the issue

Let's say that I am a developer and I have a module which offers the users several options via a drop-down module. Now suppose that based on the selection I want to give the users another field which is strictly related to the previous choice that the user made. Right now this is not possible and a developer can simply use the manifest XML file to define fields that will be displayed on the settings page no matter what happens. The user cannot see new fields based on actions/decisions he makes.

Here is an example:

  1. Install this module - https://github.com/pfire/jgeoipfilter
  2. Find the module in the Module Manager and open the Main settings page.
  3. You'll see three fields - "Filter by country", "Select an action" and "Target URL". The "Target URL" field should be displayed only if the users selects the "Redirect to URL" option from the second drop-down menu. Right now it is not possible for developers to do this.

Check the screenshot for more details if you don't want to test this with the module I mentioned.

Expected result

Developers should be able to define actions based on users' selection in the modules' main setting page.

Actual result

Fields are taken from the manifest XML and they are displayed no matter what happens in terms of user interaction.

System information (as much as possible)

CentOS 6
PHP 5.5
MySQL 5.5

More info will be provided if needed.

Additional comments

None

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar dkanchev dkanchev - open - 17 Oct 2014
avatar dkanchev
dkanchev - comment - 17 Oct 2014

Here is the screenshot:

screen shot 2014-10-17 at 06 12 42

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

avatar betweenbrain
betweenbrain - comment - 17 Oct 2014

Am I correct in that this is a feature request as opposed to a bug?

avatar dkanchev
dkanchev - comment - 17 Oct 2014

Yup it is a feature request, but this one was also a feature request:

#4490

and I do believe that this format is best for best results and faster implementation of such requests.

avatar brianteeman
brianteeman - comment - 17 Oct 2014

Its not a problem to make a feature request @dkanchev I think that with so many people looking at bugs today its sometimes hard to see the wood from the trees

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

avatar Bakual Bakual - change - 17 Oct 2014
Labels Added: ?
avatar dkanchev
dkanchev - comment - 17 Oct 2014

Totally agree :) That's why we clarified that this is a feature request and people will not be confused.

avatar brianteeman
brianteeman - comment - 17 Oct 2014

@Bakual has added the New Feature label now.

avatar dimitargsg
dimitargsg - comment - 17 Oct 2014

@test I reproduced this on my end as well and agree that without such functionality, the extra field is quite misleading.

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

avatar Bakual
Bakual - comment - 17 Oct 2014

Actually, this is already possible, but I think it's not documented.

Try this in your XML:

<field
    name="action_type"
    type="list"
    label="Select an action"
    description=""
    default=""
    >
    <option value="0">Show 404 Not Found error</option>
    <option value="1">Show 403 Forbidden error</option>
    <option value="2">Redirect to URL</option>
</field>
<field
    name="redirect_url"
    type="url"
    label="Target URL"
    description=""
    default="http://www.siteground.com"
    size="10"
    showon="action_type:2"
/>

Notice the showon attribute on the field you want to hide. The value defines on which field it should trigger and after the colon which values this field should have to show the current field. You can even pass a coma-separated list of values after the colon.

@dkanchev Can you verify that this is what you wanted?

avatar brianteeman brianteeman - change - 18 Oct 2014
Status New Information Required
avatar dkanchev
dkanchev - comment - 20 Oct 2014

@Bakual great information - 10x for sharing. In this case the status of this bug could be changed to "Invalid" and the only thing that should be done is for the documentation to be updated.

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

avatar Bakual Bakual - close - 20 Oct 2014
avatar Bakual Bakual - change - 20 Oct 2014
Status Information Required Fixed in Code Base
avatar Bakual Bakual - change - 20 Oct 2014
Closed_Date 0000-00-00 00:00:00 2014-10-20 09:03:37
avatar Bakual
Bakual - comment - 20 Oct 2014

Add a Comment

Login with GitHub to post a comment