Opened 3 years ago

Closed 14 months ago

Last modified 14 months ago

#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


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 3 years ago by Franz

This seems to be a Javascript error. Please provide more specific information about your system environment, especially:

  • used web browser incl. version
  • used trac version
  • used budgeting version
  • used database
  • are there any error messages in your trac log? when yes - what does it say?

A more detailed error message of your browser would also help (e.g. by using Firebug in Firefox or Development Kit in Chrome).

comment:2 Changed 3 years ago by anonymous'-'+column+"-Insert";td.appendChild(columnElement);}

Gives an javascript error. at row 18

Last edited 3 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 3 years ago by mikal

This can be reproduced with bitnami ubuntu vmware trac image:

This is running basic of version Trac 1.0.4 and the plugin was installed using the compiled egg.

comment:4 Changed 3 years ago by anonymous

Thanks, guys! Didn't have a chance to attach the requested information :(

comment:5 Changed 3 years ago by Nikita

That was me - the originator, BTW :)

comment:7 Changed 17 months ago by javafun

  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
Last edited 17 months ago by Ryan J Ollos (previous) (diff)

comment:8 Changed 15 months ago by anonymous

I'm having the same results with default install of ubuntu trac 1.0.2

comment:9 Changed 14 months ago by Kirk

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 @@
        // 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:10 Changed 14 months ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16147:

0.6.6dev: Fix unable to add rows when default_cost not -1

Patch by linefeed. Fixes #12226.

comment:11 Changed 14 months ago by Ryan J Ollos

Owner: changed from Franz to Kirk

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Kirk.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.