? ? Pending

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
5 Jan 2017

Pull Request for Improvement.

Summary of Changes

This PR does two things:

  • Add a new "not in" condition to shown, we can use this condition by making use of the !: operator, insteadd of the normal :. This is particular useful if you want to put, for instance: field A should show on when fieldB value is not empty, ie, showon="fieldB!:", which is not possible without this PR
    Example:
// - Current
// Field A with value in 1 OR field B with value IN 1, 2 or 3
fieldname:1[OR]fieldB:1,2,3

// - NEW
// Field A with value in 1 OR field B with value NOT IN 1, 2 or 3
fieldname:1[OR]fieldB!:1,2,3
  • Normalizes showon php code across the core. Remvoe a lot of duplicated code.

Testing Instructions

  1. Apply patch
  2. Confirm current fields with showon behaviour continue to work fine
  3. Change this line line in com_config xml so the showon condition is mailonline:1[AND]mailer!:smtp.
    Now check this field will appear when the field mailonline is set to yes and the mailer is different than smtp.
  4. Make any other tests you can remember

Documentation Changes Required

Add this new operator to https://docs.joomla.org/Form_field#Showon

avatar andrepereiradasilva andrepereiradasilva - open - 5 Jan 2017
avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jan 2017
Category Administration com_config Layout Libraries JavaScript
avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 5 Jan 2017
avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 5 Jan 2017
avatar Bakual
Bakual - comment - 5 Jan 2017

Documentation can be found here: https://docs.joomla.org/Form_field#Showon

avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Jan 2017

This should be an easy simple test.
I plan to make one more upgrade to shown js (allow showon on global values), but can only do this after this is merged.
So if you have 5 minutes please test.

avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 5 Jan 2017
avatar joomdonation
joomdonation - comment - 5 Jan 2017

This seems doesn't work well. After applying the patch, in Global Configuration, Mail Settings section, if we choose SMTP, additional fields like SMTP Host, SMTP Port... are not being shown

avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Jan 2017

@joomdonation probably a bug, will check

avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Jan 2017

@joomdonation yeah it was a bug forgot to change a thing. should be solved now.

avatar joomdonation
joomdonation - comment - 5 Jan 2017

I have tested this item successfully on ecbcca1

Tested showon behavior in Global Configuration of Joomla. Before and after patch, the behavior is the same

Tested the new operator and it worked, too.


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

avatar joomdonation joomdonation - test_item - 5 Jan 2017 - Tested successfully
avatar joomdonation
joomdonation - comment - 5 Jan 2017

OK. I tested it and it seems works well. I only tested the behavior (using Google Chrome ), no code review.

avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 5 Jan 2017
avatar anibalsanchez
anibalsanchez - comment - 5 Jan 2017

I have tested this item successfully on ecbcca1

Test OK


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

avatar anibalsanchez anibalsanchez - test_item - 5 Jan 2017 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 5 Jan 2017
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 5 Jan 2017

RTC


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

avatar andrepereiradasilva andrepereiradasilva - change - 5 Jan 2017
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Jan 2017

just remove a obvious bug a double json_enconde when using showon on fieldset. no need to remove RTC IMO

avatar rdeutz rdeutz - change - 6 Jan 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-01-06 08:08:52
Closed_By rdeutz
avatar rdeutz rdeutz - close - 6 Jan 2017
avatar rdeutz rdeutz - merge - 6 Jan 2017

Add a Comment

Login with GitHub to post a comment