Element javascript sometimes not running in details

Jaanus

Super Moderator
As in form view all js set to elements works well, it happens that in details view js just don't run - even if the element is published, visible in html and no conflicts.

As Rob asked I post here an excerpt of one conversation so the issue could be better tracked.

----------------



is it possible that when having lot of element javascripts working then from some point they are "too much" and some of them just don't run?
[13:52:27] Jaanus: no ideas?
[13:53:40] P: It seems to me that it is possible, however it also seems more likely that it is a conflict or a programming error or something. I assume that there are no messages in the JS console?
[13:54:22] Jaanus: right, no error messages
[13:54:57] P: Have you looked through the fabrik code block to check that all your js is in the HTML?
[13:56:25] Jaanus: just a moment...
[14:08:27] Jaanus: there are only some messages like "Fabrik form::addElements: Cannot add element "ubie_data_facts_fiview___short_desc_ro_1" because it does not exist in HTML." but does it explain anything?
[14:11:40] CR: custom template?
[14:12:04] Jaanus: no
[14:12:55] CR: how many elements?
[14:14:50] Jaanus: element in whole form?
[14:17:39] CR: yes
[14:17:39] Jaanus: 96
[14:17:47] CR: url?
[14:18:21] Jaanus: well, just intended to show one
[14:18:33] Jaanus: Look for example here
http://www.nurmoja.net.ee/testubie/ubipaedia/details/20/4
The group ubie_data_has_ubie_contact_details should be hidden here because
element "This entry is about" has value 5 and the element is visible
[14:18:52] Jaanus: sry, value 6
[14:20:57] CR: last line in the console is the js error
[14:21:39] P: That warning message was one I introduced. Nice to see it is being helpful. :)
[14:22:18] CR: hmm sorry no i saw an error once now i dont see it
[14:22:23] Jaanus: and something else - one group that should be shown because the mentioned field has value 6. In other cases not shown. But its not displayed
[14:22:57] CR: this is a details page though - so shouldnt we be looking at the form page?
[14:23:11] Jaanus: inf form page all seems to be well
[14:23:19] CR: and are you using the latest github code?
[14:23:48] Jaanus: CR, your cerdentials are present in fabrikar.com for this site
[14:24:03] Jaanus: not the VERY latest
[14:24:13] CR: suggest doing that first
[14:25:16] P: Hmm - it is entirely possible that this is an issue specific to details templates.
[14:25:35] CR: yes thats what i think - dont think its to do with the number of elements
[14:25:43] CR: those notices are for repeat elements in a details view
[14:27:43] P: Ok - the issue seems to be one of naming...
[14:30:11 | Muudetud - 14:31:57] P: In the code block we are e.g. looking for ubie_data_facts_poview___id_ro_0 there are no elements from the table ubie_data_facts_poview in the HTML at all.
[14:30:38] P: Could it be some sort of access setting for this list which is causing it not to be in the HTML?
[14:30:46] CR: group acl set up perhaps?
[14:31:20] Jaanus: no acl
[14:31:33] P: Is poview a repeat group?
[14:31:51] Jaanus: only "shown or not shown" options
[14:32:13] Jaanus: yes, repeat group
[14:33:12] P: However, I would guess that Fabrik should be ensuring that the code block and the HTML are aligned - and if something is preventing the poview RG from being included in the HTML, then Fabrik should exclude it from the code block too.
[14:34:22] Jaanus: FYI - while I update to the very latest github, you can go to the main page and read what I did there
[14:34:26] P: I introduced the error messages because someone had reported a pCRlem - which turned out to be their using a custom template to not display certain elements, so they were still in the code block and this was bombing out the JS - so I added tests and warning messages so that the JS didn't just abort on an error.
[14:35:40] Jaanus: click on UBIE
[14:36:25] P: Yes - I must say I am VERY impressed with what you have achieved here using Fabrik!!!!
[14:38:38] P: So if you are using Fabrik's standard templates and haben't built your own as a way to eliminate certain elements from the HTML, then I think this must be a bug.
[14:39:18] CR: what js are you using the build in gui stuff or some custom js?
[14:42:17] Jaanus: no custom js, only the "prebuilt" js options
[14:43:14] Jaanus: btw, there seems to be one bug related to the operators <, >, <= and >=
[14:45:35] CR: doubt it
[14:45:49] CR: we'd have lots of people reportiing that
[14:46:38] Jaanus: Uncaught TypeError: Object [object Array] has no method 'toFloat'
Class.runLoadEvent element.js:168
e.extend.$owner mootools-core.js:38
Class.addNewEvent element.js:210
e.extend.$owner mootools-core.js:38
Class.dispatchEvent form.js:729
e.extend.$owner mootools-core.js:38
(anonymous function) 2:1261
i.execCb require.js:29
$.check require.js:18
(anonymous function) require.js:23
(anonymous function) require.js:8
(anonymous function) require.js:23
v require.js:7
$.emit require.js:23
$.check require.js:19
$.enable require.js:23
$.init require.js:17
E require.js:14
i.completeLoad require.js:28
i.onScriptLoad require.js:29
[14:47:46 | Muudetud - 14:47:55] P: Well - this page has more than one repeat group (which is less common) so if it was only related to that and to the details template, then it might not be that common and reported by anyone else.
[14:48:12] CR: true i guess
[14:49:41] Jaanus: in this form I don't use now these operators (changed the element js options), just copied this error msg to report
[14:50:16] P: Which version of Joomla / Fabrik is this using?
[14:50:40] Jaanus: 32 & 31
[14:51:24] CR: could you write a forum post summarising all of this, it will be easier to track that way
[14:52:02] Jaanus: ok, will do
[14:52:15] Jaanus: well, updating finished
[14:53:16] P: CR - line 171 in element.js has a speeling mistook - "consolde.log('delayed.....');" ... and whilst you are fixing that it might be helpful if it gave a slightly better explanation of what is delayed and for how long :).
[14:53:16] Jaanus: FYI - about customisations - I use those that I proposed in my latest PR-s, all the rest is not customised
[14:53:40] P: But line 168 is an eval - so it is evaluating something with toFloat.
[14:54:54] P: P.S. I know that php eval does not have try/except capabilities - but it might be worth wrapping any JS evals in a try / except in order to handle JS errors better.
[14:55:29] Jaanus: toFloat is written in element.php to be added if we use < > <= >= in element js
[14:58:14] P: So - one of the comparitors is an array rather than a scalar. Hence the error - but no idea what or why.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top