[BUG] Dropdown Element + InlineEdit

janon

New Member
Just using a simple dropdown element with inlineedit plugin. I am able to click the field and edit/save it successfully once. If I try to do it again (doesn't matter which row), the inline edit popup is stuck until I hit {escape} key.
--------------------------------------------------------------------------------------
My test case sauce:
Joomla: 2.5.4 (no sample data)
Fabrik: GIT Pull commit ff3a21df64

1 List + inlineedit plugin:
- activation event: single click​
1 Dropdown Element:
- value "1", label "1"​
- value "one", label "one"​
1 Main Menu Link > List
--------------------------------------------------------------------------------------
Firebug shows dropdown-min.js
c.indexOf is not a function
--------------------------------------------------------------------------------------
Fixed by changing
c = JSON.decode(c) -> c = JSON.decode( "'" + c + "'" )

Firebug was showing the decode function returning a number instead of string type in FbDropdown.update() method.
 
The inline edit plugin is currently very much "work in progress", and is on our list of things to spend some serious quality time with, as soon as we can. Until then, it's kind of "it is what it is".

I'll raise a ticket in github for this, so when we do get this plugin into the lab and on the slab (think Frankenstein), we'll know to fix this issue. I just can't guarrantee when that will be.

-- hugh
 
Ooops, didn't see your update.

Hmmm, I suspect that change may cause problems elsewhere, and that the real issue lies in the inline edit code which is calling the dropdown's update() method.

So be on the lookout for other usage of the dropdown element, like on forms, to barf up errors.

-- hugh
 
I've commited a fix for this in github, not quiet what you were suggesting as the update() method can accept json string which would be malformed if we encased them in additional quotes.
instead I've done:

Code:
if (typeOf(val) === 'string') {
            val = JSON.decode(val);
            if (typeOf(val) === 'number') {
                val = [val.toString()];
            }
        }
}
 
I didn't think the final fix would be quite so simple :) Hopefully I at least saved you some time hunting this one down. Works great.
 
Whoops, I was wrong. I used the wrong virtual machine. Pulled the latest git and still have the same problem. Opera is proving to provide an interesting twist on debugging.

I reduced the test case to just a single element of dropdown. Dropdown includes 'one' and 'two' as selections. When mootools Json.decode works its return eval('(' + string + ')'), Opera was nice enough to display the 'naked' eval statement by itself during the error: eval(one), not eval('one') or eval("one").

This made it pretty obvious, mootools doesn't ensure string encapsulation before running a javascript eval so its up to Fabrik.
 
Hows about:

Code:
update: function (val) {
var opts = [];
if (typeOf(val) === 'string') {
	val = JSON.decode("'" + val + "'");
	if (typeOf(val) === 'number') {
		val = [val.toString()];
	}
}
.....


Everything works fine with IE, Chrome, Firefox and Opera. However playing around by making one of the dropdown element's selection a literal 'test' with quotes included, I was able to crash IE 9 :eek: lol.. wtf. Opera,Chrome and Firefox all work fine. However FireFox displayed test instead of 'test' like Chrome and Opera properly did. This mystery is Rob territory no? ;D It sure got me stumped.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top