Changes between Initial Version and Version 1 of Ticket #12612, comment 5


Ignore:
Timestamp:
Dec 16, 2015, 8:48:03 PM (8 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12612, comment 5

    initial v1  
    11I currently have only the patched version of the plugin installed but I did some debugging.
    2 The real problem seems to be here where there are no input fields to attach the change event (like the agilo enabled main page). Here: https://trac-hacks.org/browser/dynamicfieldsplugin/trunk/dynfields/htdocs/dynfields.js?rev=15114#L78
     2The real problem seems to be here where there are no input fields to attach the change event (like the agilo enabled main page). Here: [browser:dynamicfieldsplugin/trunk/dynfields/htdocs/dynfields.js@15114#L78]
    33
    4 {{{
     4{{{#!javascript
    55    // collect all input fields that trigger rules
    66    $.each(triggers, function (trigger, specs) {
     
    1616}}}
    1717
    18 While there are no input fields it still tries to attach apply_rules to change event and then trigger the change(). 'inputs' array contents are [ undefined ].
     18While there are no input fields it still tries to attach `apply_rules` to change event and then trigger the `change()`. `inputs` array contents are `[ undefined ]`.
    1919Stack trace at the offending line is like this:
    2020{{{
     
    4747}}}
    4848
    49 Console for the non-patched plugin says that cannot call slice() on 'undefined' on the non-patched offending line (https://trac-hacks.org/browser/dynamicfieldsplugin/trunk/dynfields/htdocs/rules.js?rev=15114&marks=175#L175).
     49Console for the non-patched plugin says that cannot call slice() on 'undefined' on the non-patched offending line ([browser:dynamicfieldsplugin/trunk/dynfields/htdocs/rules.js@15114:175#L175]).
    5050
    51 And yes, input.attr('id') is indeed undefined.  input is Object [ Window sandbox ], i.e. the main window which is the case for example when loading the main wiki page. It is not specific to agilo; happens also with vanilla trac.
     51And yes, `input.attr('id')` is indeed undefined.  input is `Object [ Window sandbox ]`, i.e. the main window which is the case for example when loading the main wiki page. It is not specific to agilo; happens also with vanilla trac.
    5252
    53 Is it so that on vanilla trac there happens to be no more document.ready functions to be executed so the bug remains hidden? I tried the plugin with a vanilla trac installation and undefined input.attr('id') exists there also but no visible harm is done unless there is another plugin which expects its document ready() to be called.
     53Is it so that on vanilla trac there happens to be no more `document.ready` functions to be executed so the bug remains hidden? I tried the plugin with a vanilla trac installation and undefined `input.attr('id')` exists there also but no visible harm is done unless there is another plugin which expects its document `ready()` to be called.