Modify

Opened 9 years ago

Closed 7 years ago

Last modified 7 years 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

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 9 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 9 years ago by anonymous

columnElement.name=rowCounter+'-'+column+"-Insert";td.appendChild(columnElement);}

Gives an javascript error. at budgeting.js.pagespeed.jm.roUTGA_cLr.js row 18

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

comment:3 Changed 9 years ago by mikal

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 9 years ago by anonymous

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

comment:5 Changed 9 years ago by Nikita

That was me - the originator, BTW :)

comment:7 Changed 8 years 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

Version 0, edited 8 years ago by javafun (next)

comment:8 Changed 7 years ago by anonymous

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

comment:9 Changed 7 years 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 @@
        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:10 Changed 7 years 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 7 years ago by Ryan J Ollos

Owner: changed from Franz to Kirk

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Kirk.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.