User tests: Successful: Unsuccessful:
... 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.
Labels |
Added:
?
|
Gosh! Somebody beat me too it. At a glance, the other rewrite seems good. I'll try to find time to test it soon.
Category | ⇒ | Layout Libraries |
@okonomiyaki3000 have you managed to find time for testing yet. I'd be really keen to get a working version of this finally going!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-01-29 01:24:26 |
OK awesome. Thanks! If you do have any time before the stable to give it at a test would be appreciated
@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
@okonomiyaki3000 I am curious, what exactly you fixed here?