#12226 closed defect (fixed)
Cannot add budget to a ticket
Reported by: | Nikita | Owned by: | Kirk |
---|---|---|---|
Priority: | normal | Component: | BudgetingPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
While trying to add a budget line to a ticket nothing happens and I see the following message in the browser console:
Uncaught TypeError: Cannot read property 'appendChild' of undefined
Attachments (0)
Change History (10)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
columnElement.name=rowCounter+'-'+column+"-Insert";td.appendChild(columnElement);}
Gives an javascript error. at budgeting.js.pagespeed.jm.roUTGA_cLr.js row 18
comment:3 Changed 10 years ago by
This can be reproduced with bitnami ubuntu vmware trac image: https://bitnami.com/stack/trac/virtual-machine
This is running basic of version Trac 1.0.4 and the plugin was installed using the compiled egg.
comment:4 Changed 10 years ago by
Thanks, guys! Didn't have a chance to attach the requested information :(
comment:7 Changed 8 years ago by
Trac 1.0.1 Babel 1.3 Docutils 0.11 Genshi 0.7 (with speedups) Pygments 1.6 pysqlite 2.6.0 Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] pytz 2012c setuptools 3.3 SQLite 3.8.2 jQuery 1.7.2
Error log from Chrome:
budgeting.js:120 Uncaught TypeError: Cannot read property 'appendChild' of undefinedaddBudgetRow @ budgeting.js:120onclick @ VM1586 3531:462
comment:8 Changed 8 years ago by
I'm having the same results with default install of ubuntu trac 1.0.2
comment:9 Changed 8 years ago by
The bug only shows up when you don't have default_cost set to -1.
The following patch fixes the javascript errors and makes the plugin work.
Index: ticketbudgeting/htdocs/js/budgeting.js =================================================================== --- ticketbudgeting/htdocs/js/budgeting.js (revision 16144) +++ ticketbudgeting/htdocs/js/budgeting.js (working copy) @@ -66,11 +66,13 @@ tBodyContainer.append(tableRow); // Adding column by column to the row element for (column = 1; column <= columnCount; column++) { - if (column != 4 && def_cost == "-1") { - var td = document.createElement('td'); - tableRow.appendChild(td); + if ( ( column == 4 ) && def_cost == "-1" ) { + continue; } + var td = document.createElement('td'); var columnElement; + + tableRow.appendChild(td); switch (column) { case 1: // Select NAME Column Position 1
comment:11 Changed 8 years ago by
Owner: | changed from Franz to Kirk |
---|
This seems to be a Javascript error. Please provide more specific information about your system environment, especially:
A more detailed error message of your browser would also help (e.g. by using Firebug in Firefox or Development Kit in Chrome).