On Wed, Sep 8, 2010 at 9:59 PM, Steffen Hoffmann <hoff...@web.de> wrote: > >> Now I need to store value of my field data if it is added or changed, >> and I am puzzled. There is ITicketChangeListener interface that has >> ticket_created(self, ticket) and ticket_changed(self, ticket, comment, >> author, old_values) methods, but.. when I get notification about >> created ticket, how to access request environment to extract my data? >> There is no req variable passed to these methods. > AFAIK, you'll find `old_values` with historic data, that got replaced by > the new values, that you'll read from `ticket`. What else do you need?
If you add your own field into the html form in ticket.html - this field won't appear in `old_values` even if it is named the same. I also expected it to appear there, but Trac logic filters incoming data to contain only fields known to core ticket system. Why? > Anyway I completely failed to understand, why you re-invent the wheel > doing all the stuff, that custom fields would do for you with just a few > lines of configuration in trac.ini, not to mention, this is well > maintained and supported, in case you get stuck, while you're on your > own, if your code fails or is getting incompatible to Trac later on. 1. It is a tutorial for people who will be extending and maintaining Trac after me 2. They already feel uneasy about abundance of options Trac provides 3. They'd like to keep features modular - one file, one feature, no config unless ABSOLUTELY necessary 4. They'd like to add fields to other Trac forms as well (hidden or not), that's why I'd like to show a universal solution 5. I might have a desire to dance on the bones of Trac architecture =) > I > recommend to use CustomFieldAdminPlugin [1], if it is too hard for you > to study correct syntax for [ticket-custom] section. It is hard for me to write Trac plugins - much harder than I'd expect from such awesome product. -- anatoly t. -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to trac-...@googlegroups.com. To unsubscribe from this group, send email to trac-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.