Modify

Opened 2 years ago

Closed 11 months ago

#9862 closed defect (fixed)

JavaScript error doesn't allow the chart creation

Reported by: leandrosansilva@… Owned by: ChrisNelson
Priority: normal Component: TracJsGanttPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)

I installed jsganttyplugin in two debian machines, both with trac 0.12. In the first, Installed trac and jsgantt plugin from repository (testng) and in the other I installed them from website (I used easy_install to install the plugin).

This error occours in both instalations.

I configured jsgantt as described in the manual installation, but When I edit a page to create a gantt chart, nothing happens.

Looking at firebug, I can see this error (happens in both machines):

pComp.indexOf is not a function
TaskItem()                                                                jsgantt.js (line 175)
pID = 1
pName = "Define Chart API"
pStart = ""
pEnd = ""
pDisplay = "#ff0000"
pLink = "http://help.com"
pMile = 0
pRes = "Brian"
pComp = 0
pGroup = 1
pParent = 0
pOpen = 1
pDepend = Object { setFormatArr=function(), setShowRes=function(), setShowDur=function(), more...}
pCaption = undefined
g = undefined

WikiStart (linha 101)

if (pComp.indexOf('/') == -1) {

jsgantt.js (line 175)

Attachments (0)

Change History (12)

comment:1 Changed 2 years ago by rjollos

  • Description modified (diff)

comment:2 Changed 2 years ago by leandrosansilva@…

  • Trac Release changed from 0.11 to 0.12

Ops, I forgot to set correctly the trac version in the ticket description.

comment:3 Changed 2 years ago by battlebug12@…

Same problem here with latest revision 11441. Seems like the sample tickets are _always_ rendered, even if I use "TracJSGanttChart(milestone=milestone1,sample=0)".

The sample tickets seem to be faulty. The rendered Javascript gives 13 arguments (tracjsgantt.py:238+), the Javascript function wants 15 arguments (jsgantt.js:76).

I thought it has worked last week... I think this problem only applies to the sample tickets, but a tip how I can get the normal tickets working would be nice...

comment:4 Changed 2 years ago by battlebug12@…

Debugged further. tracjsgantt.py:550

if options.get('sample'):

this returns u'0', not an integer, so this always applies.

comment:5 Changed 2 years ago by ChrisNelson

I'm confused about this. It works for me in 0.11. I have:

    IntOption('trac-jsgantt', 'option.sample', 0,
              """Show sample Gantt""")

Is IntOption() broken in 0.12 to return a string, not an int?

comment:6 follow-up: Changed 22 months ago by anonymous

Same problem here. Not activity by the maintainer, it seems: already 3 months since last entry. Is this project dead/abandoned?

comment:7 in reply to: ↑ 6 Changed 22 months ago by ChrisNelson

  • Summary changed from Javascript error doesn't allow the chart creation to JavaScript error doesn't allow the chart creation

Replying to anonymous:

Same problem here. Not activity by the maintainer, it seems: already 3 months since last entry. Is this project dead/abandoned?

Definitely not abandoned. I'm sorry for the slow responses on T-H. We've done a lot of development in house for our short-term needs and now I need to figure out how to test, integrate, and release that to T-H.

I will try to review issues here soon. If I can resolve them first on the T-H branch then merge that back to my version, I will.

comment:8 Changed 22 months ago by ChrisNelson

(In [12158]) Options are unicode strings, not integers. Refs #9862.

comment:9 Changed 22 months ago by ChrisNelson

(In [12159]) Pass Gantt as first paremeter when constructing tasks. Refs #9862.

"Real" tasks always pass all parameters but the sample tasks omit
trailing parameters that are null. The Gantt argument was added last
without care taken to add empty arguments before it with "". This
moves it first because it must always be there. Then the samples with
optional final arguments can be constructed properly.

Version 0, edited 22 months ago by ChrisNelson (next)

comment:10 Changed 22 months ago by ChrisNelson

(In [12160]) More unique chart IDs. Refs #9862.

When testing with a sample then a real chart on the same page I wasn't
seeing the sample because the chart ID had only 1-second resolution and
the sample drew so fast that the real chart had the same ID. Now we use
microseconds for chart IDs.

comment:11 Changed 22 months ago by ChrisNelson

  • Status changed from new to assigned

comment:12 Changed 11 months ago by ChrisNelson

  • Resolution set to fixed
  • Status changed from assigned to closed

I believe this is fixed and I got no feedback from the OP. I'm going to call it good.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from ChrisNelson. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.