Modify ↓
Opened 15 years ago
Closed 10 years ago
#6241 closed enhancement (worksforme)
Support TraM
Reported by: | okamototk | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | CustomFieldAdminPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Hi,
CustomFieldAdminPlugin had a problem with with TraM plugin which support multi project in Trac. With TraM, it custom field was not change immediate in admin panel.
The solution is reset custom_fields cache when display custom_fields. Please apply following patch:
Index: customfieldadmin/api.py =================================================================== --- customfieldadmin/api.py (revision 7160) +++ customfieldadmin/api.py (working copy) @@ -36,10 +36,13 @@ """ Returns the custom fields from TicketSystem component. Use a cfdict with 'name' key set to find a specific custom field only """ + ts = TicketSystem(env.compmgr) + ts._custom_fields = None + if not customfield: # return full list - return TicketSystem(env.compmgr).get_custom_fields() + return ts.get_custom_fields() else: # only return specific item with cfname - all = TicketSystem(env.compmgr).get_custom_fields() + all = ts.get_custom_fields() for item in all: if item['name'] == customfield['name']: return item
best regards,
Takashi Okamoto
Attachments (0)
Change History (2)
comment:1 Changed 15 years ago by
comment:2 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Seems reasonable to close it as worksforme then.
Note: See
TracTickets for help on using
tickets.
Whenever a field changes (new, update, delete), the
trac.ini
file is updated. And whentrac.ini
timestamp changes, Trac will reload the environment fetching all fresh code components (instances) for use. This is checked by Trac for every request. Resetting the cache explicitly should never really be needed.If TraM needs it, then that suggests some larger problem with that plugin or its configuration. I don't know the plugin, what it does and how it does it, but I'm hesitant about adding workaround code for such a plugin to my code - no matter how trivial the change may look.