Modify

Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#1579 closed defect (fixed)

0.11 compatibility

Reported by: bewst Owned by: Radek Bartoň
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

     
    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 (2)

tracdiscussion.patch (4.8 KB) - added by Dave Abrahams <dave@…> 17 years ago.
complete 0.11 compatibility (using clearsilver)
tracdiscussion.new.patch (6.5 KB) - added by bewst 17 years ago.
updated patch that also handles notification properly

Download all attachments as: .zip

Change History (14)

comment:1 Changed 18 years ago by Radek Bartoň

Status: newassigned

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.

comment:2 Changed 17 years ago 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.

Changed 17 years ago by Dave Abrahams <dave@…>

Attachment: tracdiscussion.patch added

complete 0.11 compatibility (using clearsilver)

comment:3 Changed 17 years ago by Radek Bartoň

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?

comment:4 Changed 17 years ago by Dave Abrahams <dave@…>

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.]

Changed 17 years ago by bewst

Attachment: tracdiscussion.new.patch added

updated patch that also handles notification properly

comment:5 in reply to:  3 Changed 17 years ago 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.

comment:6 Changed 17 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

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).

comment:7 Changed 17 years ago by bewst

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

comment:8 Changed 17 years ago by Radek Bartoň

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.

comment:9 Changed 17 years ago by anonymous

Resolution: fixed
Status: closedreopened
Type: enhancementdefect

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?

comment:10 Changed 17 years ago by Radek Bartoň

Resolution: fixed
Status: reopenedclosed

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.

comment:11 in reply to:  8 Changed 17 years ago 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.

comment:12 Changed 17 years ago by bewst

The result is #1715

Modify Ticket

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