Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11882 closed defect (fixed)

CondFields not working in Trac 1.0

Reported by: rpshaw Owned by: rpshaw
Priority: normal Component: CondFieldsPlugin
Severity: normal Keywords:
Cc: rpshaw Trac Release: 1.0

Description

Hello,

I have just recently upgraded from 0.11.5 to 1.0, and I installed Confields 2.0 by doing the following:

  • Download zip file
  • $ cd condfieldsplugin/0.11
  • Change python to 2.7
  • $ python setup.py bdist_egg
  • Copy egg to plugins/ dir of trac installation
  • Enable in trac.ini and add [condfields] section from old trac.ini.

When I do this, I don't get any seeming errors in the log file, but all of the custom fields are shown for all ticket types, instead of the subset that CondFields should provide.

Is there something I did wrong, or is CondFields not supported in 1.0? Also, are there any known conflicts with other plugins (I have loaded several others, including Announcer, TracNav, XMLRPC, etc.)?

Thanks, Ryan

Attachments (1)

view.js (10.7 KB) - added by rpshaw 10 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by Ryan J Ollos

I did some quick testing in Trac 1.0 and the plugin seems to work okay.

With the log level set to DEBUG, do you see the plugin loading when you restart Trac?

06:12:17 PM Trac[loader] DEBUG: Loading condfields.admin from /home/user/Workspace/trachacks.git/condfieldsplugin/0.11
06:12:17 PM Trac[loader] DEBUG: Loading condfields.web_ui from /home/user/Workspace/trachacks.git/condfieldsplugin/0.11

Could you post your [condfields] section?

comment:2 Changed 10 years ago by Ryan J Ollos

Also, take a look in the browser console for JavaScript errors on page load. You can also try disabling all of your other plugins temporarily. A conflict with another plugin would not be too surprising.

comment:3 in reply to:  1 Changed 10 years ago by rpshaw

Replying to rjollos:

With the log level set to DEBUG, do you see the plugin loading when you restart Trac?

I do indeed see that in the log when the log level is set to DEBUG.

Could you post your [condfields] section?

Here it is:

[condfields]
defect = customer,user,program,duedate,defectroot,ticketstatus,controllingagent,devteam,timeactual,versionsfixedin
enhancement = customer,user,program,duedate,defectroot,ticketstatus,controllingagent,devteam,storypoints,versionsfixedin
include_standard = true
randarequest = ra_contact_org,ra_contactname,ra_contact_mailstop,ra_document_title,ra_contact_email,ra_contact_phone
show_default = true

comment:4 in reply to:  2 Changed 10 years ago by rpshaw

Replying to rjollos:

Also, take a look in the browser console for JavaScript errors on page load.

I'm not a JavaScript expert, but this error shows up in Firefox, Explorer, and Chrome:

[10:36:15.264] TypeError: re_results is null @ https://path/to/trac/condfields/view.js:117

I've attached view.js to this ticket, in case there is something that could be fixed.

You can also try disabling all of your other plugins temporarily. A conflict with another plugin would not be too surprising.

I'll also try to deactivate all other plugins to see if there is a conflict.

Changed 10 years ago by rpshaw

Attachment: view.js added

comment:5 in reply to:  2 Changed 10 years ago by rpshaw

Replying to rjollos:

You can also try disabling all of your other plugins temporarily. A conflict with another plugin would not be too surprising.

I did disable all other plugins, but the same behavior occurs - the plugin loads, but there is the afore-mentioned JavaScript error.

comment:6 Changed 10 years ago by anonymous

Hello,

I got past this with a change to the condfields.js file: Old:

  if (mode == 'view') {
    var status_re = /\(\w+ ([^:]+)(: \w+)?\)/;
    var re_results = status_re.exec($('span.status').text());
    set_header_type(re_results[1]);
  }

New:

  if (mode == 'view') {
    set_header_type($('#field-type').val());
  }

It seems to be doing the right thing, but I don't really know what it was trying to do in the old version of this. Am I doing something really bad?

comment:7 Changed 10 years ago by Ryan J Ollos

Owner: changed from anonymous to Ryan J Ollos
Resolution: fixed
Status: newclosed

In 14079:

Ticket type was not being properly extracted in Trac 1.0 and later. Fixes #11882.

Patch by rpshaw.

comment:8 Changed 10 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to rpshaw

It looks like that regex was left over from the Trac 0.10 implementation, and it just happened to work in Trac 0.11: trac:browser:/tags/trac-0.10/templates/ticket.cs@:33-38#L31. Your fix looks good.

comment:9 Changed 10 years ago by Ryan J Ollos

In 14081:

Update properties table when ticket type changes. Refs #11882.

comment:10 Changed 10 years ago by Ryan J Ollos

I noticed another issue. All of the ticket fields are shown in the ticket properties table when pages does an autopreview. That is probably going to be a lot trickier to fix.

comment:11 in reply to:  10 Changed 10 years ago by Ryan J Ollos

Replying to rjollos:

I noticed another issue. All of the ticket fields are shown in the ticket properties table when pages does an autopreview. That is probably going to be a lot trickier to fix.

=> #11920.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain rpshaw.
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.