Ticket #1579 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

0.11 compatibility

Reported by: bewst Assigned to: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

I need trac 0.11 compatibility and unfortunately don't understand the templating system well enough to do the job myself. I can offer this patch which I hope does part of it:

  • notification.py

    old new  
    7474        subject = self.topic['subject'] 
    7575 
    7676        # Set set e-mail template values. 
    77         self.hdf.set_unescaped('discussion.re', re) 
    78         self.hdf.set_unescaped('discussion.prefix', prefix) 
    79         self.hdf.set_unescaped('discussion.title', title) 
    80         self.hdf.set_unescaped('discussion.id', id) 
    81         self.hdf.set_unescaped('discussion.author', author) 
    82         self.hdf.set_unescaped('discussion.time', time) 
    83         self.hdf.set_unescaped('discussion.moderators', moderators) 
    84         self.hdf.set_unescaped('discussion.subject', subject) 
    85         self.hdf.set_unescaped('discussion.body', body) 
    86         self.hdf.set_unescaped('discussion.link', link) 
     77        try: 
     78            hdf = self.hdf 
     79        except AttributeError: 
     80            set_data = self.data.__setitem__ 
     81        else: 
     82            set_data = hdf.set_unescaped 
     83 
     84        for a in 're prefix title id author time moderators subject body link'.split(): 
     85            set_data(a, locals()[a]) 
    8786 
    8887        # Render body and send notification. 
    8988        subject = self.hdf.render('discussion-notify-subject.cs') 

Attachments

tracdiscussion.patch (4.8 kB) - added by Dave Abrahams <dave@boost-consulting.com> on 06/18/07 08:41:47.
complete 0.11 compatibility (using clearsilver)
tracdiscussion.new.patch (6.5 kB) - added by bewst on 06/21/07 06:13:08.
updated patch that also handles notification properly

Change History

05/26/07 04:43:54 changed by Blackhex

  • status changed from new to assigned.

Trac 0.11 uses Genshi templates instead of ClearSilver? ones. You need to rewrite all templates so it is quite a lot of job. I hope that I find a time to do it during summer but some help would be great.

06/18/07 08:41:03 changed by anonymous

Well, 0.11 contains clearsilver backward compatibility hacks that work if CS is installed. I haven't had time yet to port all the templates, but all the other fixes in the attached patch are required to get this plugin to work, plus the patch at http://trac.edgewall.org/ticket/4547

I guess this plugin was developed on a case-insensitive filesystem as there are some case errors in imported trac module names. Also emacs complains that the utf-8 designation of all the files I touched is inaccurate, so I removed it.

06/18/07 08:41:47 changed by Dave Abrahams <dave@boost-consulting.com>

  • attachment tracdiscussion.patch added.

complete 0.11 compatibility (using clearsilver)

(follow-up: ↓ 5 ) 06/18/07 09:21:56 changed by Blackhex

I have already done a most of porting to Genshi templates and API changes. Only thing left is message list. Timeline events and searching is not tested as well. But I have bought a new laptop recently so I'm spending time with clear Gentoo installation and getting quite new hardware to work. Please be patient, I'll finish this during this or next week in worst case. I can commit changes already done right now, if you like?

06/18/07 17:51:09 changed by Dave Abrahams <dave@boost-consulting.com>

Thanks; I'm in no rush now as I have a complete working port under clearsilver. I can use my port until yours is done. [Sorry about that crack about the case-insensitive filesystem. Seems that earlier versions of Trac had capitalized some module names.]

06/21/07 06:13:08 changed by bewst

  • attachment tracdiscussion.new.patch added.

updated patch that also handles notification properly

(in reply to: ↑ 3 ) 06/21/07 06:15:08 changed by bewst

Replying to Blackhex:

I have already done a most of porting to Genshi templates and API changes. Only thing left is message list. Timeline events and searching is not tested as well. But I have bought a new laptop recently so I'm spending time with clear Gentoo installation and getting quite new hardware to work. Please be patient, I'll finish this during this or next week in worst case. I can commit changes already done right now, if you like?

I have updated my patch; I suggest you at least review my changes in case you missed something.

06/29/07 16:59:18 changed by Blackhex

  • status changed from assigned to closed.
  • resolution set to fixed.

Port to 0.11 is here. There was so many changes (208.4 kB diff) that I coudn't commit them together. Please test it well. I did't test e-mail notification because my ISP's spam-filter refuses me to send e-mails from Trac's notification, but I'll rewrite notification system soon (If I find a way how to test it).

06/29/07 21:55:06 changed by bewst

I got email notification working in my patch; did you compare changes?

(follow-up: ↓ 11 ) 06/30/07 02:52:22 changed by Blackhex

I've checked what you've changed but there is much more changes in my version so it is not comparable. Isn't my version working for you? I'm able to send e-mail, but how it look like I can't get know becasue SMTP spam refusion error occurs to me so there will be some e-mail content bugs maximally.

06/30/07 06:44:17 changed by anonymous

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • resolution deleted.

hello, I just installed the latest revision and got this error: http://www.dx9.de/tracdiscussionerror.png

is this may be something wrong on my side or what do you think? I set for me or my group the permission for DISCUSSION_ADMIN, but it is still the same. any suggestions?

06/30/07 09:09:32 changed by Blackhex

  • status changed from reopened to closed.
  • resolution set to fixed.

I think that problem is with your Trac 0.11 revision. I have tested with lastest 0.11dev-r5790. First try to update your Trac to lastest SVN revision and then if your error would still occur post a new ticket where you would describe your system info and post debug log. See BugReporting for further details.

Generally always use lastest trunk revision when trying DiscussionPlugin for 0.11 and make a separate ticket for each bug you'll find.

(in reply to: ↑ 8 ) 06/30/07 19:46:18 changed by bewst

Replying to Blackhex:

I've checked what you've changed but there is much more changes in my version so it is not comparable. Isn't my version working for you? I'm able to send e-mail, but how it look like I can't get know becasue SMTP spam refusion error occurs to me so there will be some e-mail content bugs maximally.

Haven't dared to try it yet :-)

More seriously, I've just had other priorities, but I'll try it tomorrow.

07/01/07 15:09:23 changed by bewst

The result is #1715


Add/Change #1579 (0.11 compatibility)




Change Properties
Action