? Success

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
21 Jan 2015

... I will do my best to write this without using any expletives.

The repeatable field type is badly broken although, in small doses, it appears to work. I first noticed something was wrong when I tried to use two of them in the same form. To demonstrate that this fails, I've created a simple plugin which I encourage you to install: https://github.com/okonomiyaki3000/Joomla-Repeatable-Test-Plugin

This plugin does absolutely nothing but it does have a config screen which contains two repeatable fields. Watch them fail. So I investigated and found that, as I suspected, bad scope is to blame. I guess Javascript scope can be confusing. So I fixed that and found SO MANY OTHER PROBLEMS!!!!! Gosh...

OK, so this is basically a total rewrite and I don't want to get into every problem I discovered (I'm sure I can't even remember them all) but let's just say this particular bit of jQuery-based code no longer also relies on Mootools functions for some reason...

Can we please make a new rule that Javascript code must be in strict mode? So many of the problems I found would have never existed if the original code had been using strict.

Oh yeah, this is also using layouts now which is nice and I have plans for bigger improvements that will make it a lot more flexible but this patch will at least make it work.

avatar okonomiyaki3000 okonomiyaki3000 - open - 21 Jan 2015
avatar jissues-bot jissues-bot - change - 21 Jan 2015
Labels Added: ?
avatar Fedik
Fedik - comment - 21 Jan 2015

@okonomiyaki3000 I am curious, what exactly you fixed here? :neckbeard:

avatar Fedik
Fedik - comment - 21 Jan 2015

in case you did not seen that this field was rewritten #3574
and your pull just erase all changes made there :wink:

avatar okonomiyaki3000
okonomiyaki3000 - comment - 21 Jan 2015

Gosh! Somebody beat me too it. At a glance, the other rewrite seems good. I'll try to find time to test it soon.

avatar zero-24 zero-24 - change - 21 Jan 2015
Category Layout Libraries
avatar wilsonge
wilsonge - comment - 29 Jan 2015

@okonomiyaki3000 have you managed to find time for testing yet. I'd be really keen to get a working version of this finally going!

avatar okonomiyaki3000 okonomiyaki3000 - close - 29 Jan 2015
avatar okonomiyaki3000
okonomiyaki3000 - comment - 29 Jan 2015

@wilsonge Sorry, no. But I did have a quick look at the changes in #3574 and they appear to address the major problems. It probably works as it should now. In any case, this PR should be ignored as it was built on top of pre #3574 code.

avatar okonomiyaki3000 okonomiyaki3000 - close - 29 Jan 2015
avatar okonomiyaki3000 okonomiyaki3000 - change - 29 Jan 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-01-29 01:24:26
avatar wilsonge
wilsonge - comment - 29 Jan 2015

OK awesome. Thanks! If you do have any time before the stable to give it at a test would be appreciated

avatar jrseliga
jrseliga - comment - 12 Mar 2015

@okonomiyaki3000 do your changes address the JSON string that is stored from the repeatables? The structure of the current implementation isn't friendly once it's decoded into something usable by PHP. Arrays aren't keyed, they are just indexed.

I commented a bit more on this over at #3547

avatar okonomiyaki3000
okonomiyaki3000 - comment - 13 Mar 2015

@jrseliga It does not but I agree that makes more sense.

Add a Comment

Login with GitHub to post a comment