?
avatar ReLater
ReLater
3 Oct 2017

I'm using a system plugin that adds form fields to the attribs field of articles.
It's loading an xml file with a nested fields group (subgroup of attribs). <fields name="newslinks4irc">

<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="attribs">

 <fieldset name="newslinks4irc">

  <fields name="newslinks4irc">

---Several fields here---

  </fields>

 </fieldset><!--/newslinks4irc-->

</fields>

</form>

The fields are using showon. E.g. showon="linktype:url"

...
   <field name="linktype" type="list" default="url"
   label="Link type">
    <option value="menuitem">menuitem</option>
    <option value="article">article</option>
    <option value="url">url</option>
    <option value="JNONE">JNONE</option>
   </field>
   
   <field name="url" type="url" validate="url"
    description=""
    label="Enter url"
    showon="linktype:url" />
...

This worked fine with Joomla version 3.7.5

Since Joomla 3.8.0 showon doesn't function anymore and all fields keep hidden.

  • You can download a demo plugin here: [URL removed by ReLater] It's reduced to the relevant parts.
  • Install it and activate it.
  • Open an article in back-end.
  • You'll see an tabulator "Demo Plugin contentformaddfieldsghsvs".
  • Change settings of option "Link type".
  • Expected: Other fields show and hide depending on showon attribute.
  • Actual: They don't with Joomla 3.8.0

Test it with Joomla 3.7.5. Then update Joomla to 3.8.0 and test again.

Joomla <= 3.7.5 (tested with several sites and a new installation)


04-10-_2017_00-03-41

04-10-_2017_00-04-19

04-10-_2017_00-04-53

Joomla 3.8.0 and current staging (tested with several sites and a new installation)


04-10-_2017_00-05-42

avatar ReLater ReLater - open - 3 Oct 2017
avatar joomla-cms-bot joomla-cms-bot - change - 3 Oct 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Oct 2017
avatar ReLater ReLater - change - 3 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 3 Oct 2017
avatar ReLater ReLater - change - 3 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 3 Oct 2017
avatar ReLater ReLater - change - 3 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 3 Oct 2017
avatar ReLater ReLater - change - 3 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 3 Oct 2017
avatar ReLater ReLater - change - 3 Oct 2017
Title
3.8.0 JForm showon fails with nested groups (fields)
since 3.8.0 JForm showon fails with nested groups (fields)
avatar ReLater ReLater - edited - 3 Oct 2017
avatar ReLater
ReLater - comment - 4 Oct 2017

I've compared the HTML output concerning showon parts:

Joomla 3.7.5

<div data-showon='[{"field":"jform[attribs][newslinks4irc][linktype]","values":["url"],"sign":"=","op":""}]'>

Joomla 3.8.0

<div data-showon='[{"field":"jform[attribs.newslinks4irc][linktype]","values":["url"],"sign":"=","op":""}]'>

See [attribs][newslinks4irc] versus [attribs.newslinks4irc].

avatar ReLater
ReLater - comment - 4 Oct 2017

The multilevel bug was fixed in https://github.com/joomla/joomla-cms/pull/14007/files

foreach ($groups as $group)
{
 $formPath .= '[' . $group . ']';
}

See conversation here #14007
@laoneo @tassosm

I think this should be fixed in 3.8.1 ?

avatar ReLater
ReLater - comment - 4 Oct 2017

Please review and test PR #18222

avatar ReLater ReLater - change - 4 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 4 Oct 2017
avatar ReLater ReLater - change - 4 Oct 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-10-04 11:17:34
Closed_By ReLater
avatar ReLater ReLater - close - 4 Oct 2017
avatar ReLater
ReLater - comment - 4 Oct 2017

Closing because we have a PR now.

avatar ReLater ReLater - change - 4 Oct 2017
The description was changed
avatar ReLater ReLater - edited - 4 Oct 2017

Add a Comment

Login with GitHub to post a comment