J3 Issue ?
avatar ManfredHuebner
ManfredHuebner
4 Nov 2018

Steps to reproduce the issue

Editing a module and try to delete the module position to none

Expected result

Should be possible to assign a module to position "none" as in previous versions

Actual result

Module position cannot be set to none.

System information (as much as possible)

Joomla 3.9.0, PHP 7.1

Additional comments

avatar ManfredHuebner ManfredHuebner - open - 4 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Nov 2018
avatar brianteeman
brianteeman - comment - 6 Nov 2018

Which version of Joomla are you referring to?

avatar ManfredHuebner
ManfredHuebner - comment - 6 Nov 2018

Sorry, Joomla 3.9. In 3.8.13 it worked. The choosen element doesn't have the attribute -deselect but in 3.8.13 it has. Unfortunately, I wasn't able to determine in which part of the code the attribute is set (maybe in JS of the choosen library)

avatar ManfredHuebner ManfredHuebner - change - 6 Nov 2018
The description was changed
avatar ManfredHuebner ManfredHuebner - edited - 6 Nov 2018
avatar infograf768
infograf768 - comment - 6 Nov 2018

I confirm the issue.
This is what we got before 3.9.x
screen shot 2018-11-06 at 15 41 36

When clicking on the cross it deleted the position, thus setting it to None.
The cross is absent in 3.9.0 and staging.

avatar infograf768 infograf768 - change - 6 Nov 2018
Labels Added: J3 Issue
avatar infograf768 infograf768 - labeled - 6 Nov 2018
avatar infograf768
infograf768 - comment - 8 Nov 2018
avatar Quy
Quy - comment - 9 Nov 2018

In chosen.query.js:
under 3.8.13, this.options.allow_single_deselect is true.
under 3.9.0, this.options.allow_single_deselect is undefined.

I don't know where this value is set.

avatar ManfredHuebner
ManfredHuebner - comment - 9 Nov 2018

I also try to figure that out and cannot find. So I guess, the chosen version has changed and that's the reason.

avatar infograf768
infograf768 - comment - 9 Nov 2018
avatar ManfredHuebner
ManfredHuebner - comment - 9 Nov 2018

Mysterious.
I can remember that we have had a similar issue back in a previous version. Unfortunately, I cannot remember which one ;-)

avatar infograf768
infograf768 - comment - 9 Nov 2018

I found a way to solve this. can you test?
Modify
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_modules/views/module/tmpl/edit_positions.php#L26

by using
'id' => 'jform_position_chzn', // i.e. adding _chzn to the id

The drawback is that we get in source a double _chzn for the <div id:
screen shot 2018-11-09 at 11 29 38

I can get rid of it in chosen.query.js by taking off + "_chzn" in

      if (this.form_field.id.length) {
        container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chzn";

But this may have undesired results.

avatar infograf768
infograf768 - comment - 9 Nov 2018

BTW: I guess same issue when editing modules in frontend.

avatar dgrammatiko
dgrammatiko - comment - 9 Nov 2018

@infograf768 sorry but the error is not in the chosen file!!!
unset($this->_scripts["/media/system/js/moduleorder.js"]); and you'll see that the x button reappears. SO whatever was committed in the moduleorder script is wrong

avatar infograf768
infograf768 - comment - 9 Nov 2018

Looking

avatar infograf768
infograf768 - comment - 9 Nov 2018

I confirm.
reverting #21692 corrects this behavior.

avatar infograf768 infograf768 - change - 11 Nov 2018
Labels Added: ?
avatar infograf768 infograf768 - labeled - 11 Nov 2018
avatar infograf768
infograf768 - comment - 12 Nov 2018

@Fedik
Can you have a look at this please? I can't find how to modify the js except by reverting.

avatar Fedik
Fedik - comment - 12 Nov 2018

I will try

avatar infograf768
infograf768 - comment - 12 Nov 2018

tks

avatar dgrammatiko
dgrammatiko - comment - 12 Nov 2018

Reverting is the best choice, that field doesn't need to be governed by chosen and if the styling (that was the issue solved there, right?) doesn't fit the rest of the chosen fields just update the CSS. DO NOT add javascript to fix CSS problems...

avatar Fedik
Fedik - comment - 12 Nov 2018

please test #23052

avatar joomla-cms-bot joomla-cms-bot - change - 12 Nov 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-11-12 17:34:38
Closed_By joomla-cms-bot
avatar Quy Quy - change - 12 Nov 2018
Closed_By joomla-cms-bot Quy
avatar joomla-cms-bot joomla-cms-bot - close - 12 Nov 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 12 Nov 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/22935

avatar wilsonge wilsonge - change - 21 Mar 2019
Labels Removed: ?
avatar wilsonge wilsonge - unlabeled - 21 Mar 2019

Add a Comment

Login with GitHub to post a comment