Modify

Opened 16 years ago

Closed 16 years ago

Last modified 11 years ago

#3541 closed defect (fixed)

Feed is always empty

Reported by: Filipe Correia Owned by: nikolaus
Priority: normal Component: DetailedRssFeedPlugin
Severity: normal Keywords:
Cc: Filipe Correia Trac Release: 0.11

Description

I'm not getting any entry in the detailed feed. Perhaps i'm doing something wrong?

Attachments (1)

trac-detailedrssfeed-plugin.spec (2.2 KB) - added by anonymous 16 years ago.
Specfile for the plugin. Tested in CentOS 5.x.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 16 years ago by nikolaus

Status: newassigned

Interesting. Can you check the log file for me? It'll be in [trac environment directory]/log/trac.log, if you've got file logging turned on. I assume you're running .11 or higher?

Also, I just realized that there's a Detailed RSS Feed link on the "Available Reports" page - this link will always return a blank feed (it shouldn't be there). Only the feed links on the actual report pages should work.

Anyway, if you could get back to me with that log file or perhaps some more detailed description of what you're doing that'd be great. Thanks!

comment:2 Changed 16 years ago by anonymous

2008-08-12 16:53:29,003 Trac[loader] DEBUG: Loading ReportToDetailedRSS from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,003 Trac[loader] DEBUG: Loading timingandestimationplugin from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,003 Trac[loader] DEBUG: Loading STractistics from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,003 Trac[loader] DEBUG: Loading includemacro.macros from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.ticket.web_ui from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.mimeview.php from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.ticket.query from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.attachment from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.versioncontrol.svn_fs from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,004 Trac[loader] DEBUG: Loading trac.mimeview.patch from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,005 Trac[loader] DEBUG: Loading trac.mimeview.txtl from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,007 Trac[loader] DEBUG: Skipping "trac.mimeview.txtl = trac.mimeview.txtl [textile]": ("textile>=2.0" not found)
2008-08-12 16:53:29,007 Trac[loader] DEBUG: Loading trac.admin.web_ui from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,007 Trac[loader] DEBUG: Loading trac.ticket.admin from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,007 Trac[loader] DEBUG: Loading trac.mimeview.rst from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,010 Trac[loader] DEBUG: Skipping "trac.mimeview.rst = trac.mimeview.rst [rest]": ("docutils>=0.3" not found)
2008-08-12 16:53:29,010 Trac[loader] DEBUG: Loading trac.db.postgres from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,010 Trac[loader] DEBUG: Loading trac.versioncontrol.web_ui from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,010 Trac[loader] DEBUG: Loading trac.timeline from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,010 Trac[loader] DEBUG: Loading trac.mimeview.pygments from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,013 Trac[loader] DEBUG: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": ("Pygments>=0.6" not found)
2008-08-12 16:53:29,013 Trac[loader] DEBUG: Loading trac.about from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,013 Trac[loader] DEBUG: Loading trac.ticket.roadmap from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,013 Trac[loader] DEBUG: Loading trac.mimeview.silvercity from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Skipping "trac.mimeview.silvercity = trac.mimeview.silvercity [silvercity]": ("SilverCity>=0.9.4" not found)
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Loading trac.wiki.macros from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Loading trac.db.sqlite from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Loading trac.wiki.web_ui from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Loading trac.mimeview.enscript from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,016 Trac[loader] DEBUG: Loading trac.web.auth from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,017 Trac[loader] DEBUG: Loading trac.admin.console from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,017 Trac[loader] DEBUG: Loading trac.db.mysql from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,017 Trac[loader] DEBUG: Loading trac.search from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,017 Trac[loader] DEBUG: Loading trac.prefs from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,017 Trac[loader] DEBUG: Loading trac.ticket.report from /usr/lib/python2.4/site-packages
2008-08-12 16:53:29,020 Trac[default_workflow] DEBUG: Workflow actions at initialization: {'resolve': {'operations': [u'set_resolution'], 'name': 'resolve', 'default': 0, 'newstate': u'closed', 'oldstates': [u'new', u'assigned', u'reopened'], 'permissions': [u'TICKET_MODIFY']}, 'accept': {'operations': [u'set_owner_to_self'], 'name': 'accept', 'default': 0, 'newstate': u'assigned', 'oldstates': [u'new'], 'permissions': [u'TICKET_MODIFY']}, 'leave': {'operations': [u'leave_status'], 'name': 'leave', 'default': 1, 'newstate': u'*', 'oldstates': [u'*'], 'permissions': []}, 'reopen': {'operations': [u'del_resolution'], 'name': 'reopen', 'default': 0, 'newstate': u'reopened', 'oldstates': [u'closed'], 'permissions': [u'TICKET_CREATE']}, 'reassign': {'operations': [u'set_owner'], 'name': 'reassign', 'default': 0, 'newstate': u'new', 'oldstates': [u'new', u'assigned', u'reopened'], 'permissions': [u'TICKET_MODIFY']}, '_reset': {'operations': ['reset_workflow'], 'name': 'reset', 'default': 0, 'newstate': 'new', 'oldstates': [], 'permissions': []}}

2008-08-12 16:53:29,031 Trac[api] DEBUG: NEEDS UP?: sys:False, rep:False, stats:False, fields:False, man:False
2008-08-12 16:53:29,037 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2008-08-12 16:53:29,038 Trac[main] DEBUG: Dispatching <Request "GET u'/report/1'">
2008-08-12 16:53:29,040 Trac[svn_fs] DEBUG: Subversion bindings imported
2008-08-12 16:53:29,042 Trac[chrome] DEBUG: Prepare chrome data for request
2008-08-12 16:53:29,044 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
2008-08-12 16:53:29,051 Trac[report] DEBUG: Executing report with SQL "
SELECT p.value AS __color__,
   id AS ticket, summary, component, version, milestone, t.type AS type, 
   owner, status,
   time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter
  FROM ticket t, enum p
  WHERE status <> 'closed' 
AND p.name = t.priority AND p.type = 'priority'
  ORDER BY p.value, milestone, t.type, time
"
2008-08-12 16:53:29,051 Trac[report] DEBUG: Request args: {'detailed': u'true', 'id': u'1', 'format': u'rss'}
2008-08-12 16:53:29,117 Trac[session] DEBUG: Retrieving session for ID 'joliveira'
2008-08-12 16:53:29,119 Trac[tande_filters] DEBUG: self.billing_reports= Set([])
2008-08-12 16:53:29,157 Trac[main] DEBUG: 22058 unreachable objects found.

comment:3 Changed 16 years ago by anonymous

By the way, Firefox wasn't able to parse the generated XML file.
Here is the patch we had to apply to your template file.

diff -ruN detailedrssfeedplugin-original/ReportToDetailedRSS/templates/detailedrss.rss detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss
--- detailedrssfeedplugin-original/ReportToDetailedRSS/templates/detailedrss.rss»···2008-08-04 17:59:28.000000000 +0100
+++ detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss»2008-08-12 01:51:01.000000000 +0100
@@ -1,4 +1,4 @@
-<?xml version="1.1"?>
+<?xml version="1.0"?>
 <?xml-stylesheet type="text/css" href="http://localhost/trac/chrome/common/css/ticket.css"?>
 <rss version="2.0" xmlns:py="http://genshi.edgewall.org/"
                    xmlns:xi="http://www.w3.org/2001/XInclude">

comment:4 in reply to:  1 ; Changed 16 years ago by nikolaus

Replying to oneirist:

Also, I just realized that there's a Detailed RSS Feed link on the "Available Reports" page - this link will always return a blank feed (it shouldn't be there). Only the feed links on the actual report pages should work.

I've uploaded a new version that only shows the link on the pages where it should exist. (not to say this is solving the problem you're having; merely to say that I discovered this new bug while looking through the code just now and I've fixed it)

I was hoping your log file would show some sort of glaring error that I could fix. It didn't.
However, I've been looking through the code and I can think of a reason nothing would be showing up. In trac.ini there's a line under [report] that says "items_per_page_rss = n" if n is 0, then you'll be getting 0 items (this is a property of sqlite: I use the number there as the LIMIT of the query). If you want an unlimited number, set this line to -1.*
Also however, I've realized that this is stupid behaviour on the part of my plugin, so I've uploaded a new version of the code that assumes that if n is 0 then you really want an unlimited number, not 0. I also added some logging into the code to make future debugging more easy.

Tell me if it works for you.

I'm not sure, also, why telling Firefox that the xml version is 1.0 instead of 1.1 would change anything. As far as I know, all 1.1 did was add more unicode support or something, and should be backward compatible in this case.

*Note: when I use the number, I actually use it as number of changes, not number of items. If you change a ticket 100 ways at once and your limit is 100, you'll only have one item in the feed but it will show all 100 changes. I don't know if such behaviour is desirable; I can change it if you like.

comment:5 in reply to:  4 ; Changed 16 years ago by anonymous

Replying to oneirist:

Replying to oneirist: ...[SKIP]... Tell me if it works for you.

It works. Thanks.

I'm not sure, also, why telling Firefox that the xml version is 1.0 instead of 1.1 would change anything. As far as I know, all 1.1 did was add more unicode support or something, and should be backward compatible in this case.

I still have to apply two patches in order to keep Firefox 2.0.0.16 (Windows) and 3.0.1 (MacOSX) happy (these appear to be Firefox shortcomings):

1 - Mime type

Firefox prompts to save the file unless I change the mime type to "application/xhtml+xml"

Patch (change only the first occurence of application/rss+xml):

diff -ruN detailedrssfeedplugin-original/ReportToDetailedRSS/ReportToDetailedRSS.py detailedrssfeedplugin/ReportToDetailedRSS/ReportToDetailedRSS.py
--- detailedrssfeedplugin-original/ReportToDetailedRSS/ReportToDetailedRSS.py   2008-08-04 17:59:28.000000000 +0100
+++ detailedrssfeedplugin/ReportToDetailedRSS/ReportToDetailedRSS.py    2008-08-12 01:45:09.000000000 +0100
@@ -35,7 +35,7 @@
         rmodule = ReportModule(self.env)
         if rmodule.match_request(req): #report's match request. if it's gonna be true then we'll stick in our translator
             add_link(req, 'alternate', '?format=rss&detailed=true' , _('Detailed RSS Feed'),
-                'application/rss+xml', 'rss')
+                'application/xhtml+xml', 'rss')
         return handler
 
     # for ClearSilver templates

2 - XML version

Unless I change the xml version to 1.0 Firefox will present the following output:

      XML Parsing Error: XML declaration not well-formed
      Location: http://trac/gisa/report/1?format=rss&detailed=true
      Line Number 1, Column 16:<?xml version="1.1"?>
      ---------------^

Patch:

diff -ruN detailedrssfeedplugin.orig/ReportToDetailedRSS/templates/detailedrss.rss detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss
--- detailedrssfeedplugin.orig/ReportToDetailedRSS/templates/detailedrss.rss    2008-08-12 16:34:34.000000000 +0100
+++ detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss 2008-08-12 18:21:07.000000000 +0100
@@ -1,4 +1,4 @@
-<?xml version="1.1"?>
+<?xml version="1.0"?>
 <rss version="2.0" xmlns:py="http://genshi.edgewall.org/"
                    xmlns:xi="http://www.w3.org/2001/XInclude">
     <xi:include href="macros.rss" />

At least Firefox, Safari, and IE7 work with these two small patches applied. Could you consider applying them?

Any way, thanks again for your troubleshooting time.

comment:6 Changed 16 years ago by anonymous

Hi again,

Could you also update the plugin version and add license information (maybe BSD like trac) to the setup.py file?

tia, jpo

comment:7 in reply to:  5 ; Changed 16 years ago by nikolaus

Replying to anonymous:

Firefox prompts to save the file unless I change the mime type to "application/xhtml+xml"

I find this to be very odd: the report module itself has this line for getting normal report feeds:

return 'report.rss', data, 'application/rss+xml'

and I got my content-type from there. Do the normal report feeds work correctly, or does firefox want to download them?

Unless I change the xml version to 1.0 Firefox will present the following output:

I've changed the version to 1.0.

comment:8 in reply to:  7 Changed 16 years ago by anonymous

Replying to oneirist:

Replying to anonymous:

Firefox prompts to save the file unless I change the mime type to "application/xhtml+xml"

I find this to be very odd: the report module itself has this line for getting normal report feeds:

return 'report.rss', data, 'application/rss+xml'

and I got my content-type from there. Do the normal report feeds work correctly, or does firefox want to download them?

Firefox shows the normal "RSS Feed" correctly and was from this page information that I obtained the "application/xhtml+xml" mime type. But this is a little weird:

"RSS Feed"
----------

  • Using the "Page info" option from the Firefox Tools menu I get:
    ...
    Type:  application/xhtml+xml
    ...
  • and using the "Response Headers" option from the Firefox's Web Developer add-on I get
Date: Tue, 12 Aug 2008 21:36:49 GMT
Server: Apache/2.2.3 (CentOS)
Cache-Control: must-revalidate
Content-Length: 77389
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: application/rss+xml;charset=utf-8

200 OK

Note the "application/rss+xml" mime type.

I was only to mimic the same behavior by applying the patch posted three comments up. But if I also replaced the second occurrence of "application/rss+xml" in your plugin it would break IExplorer but not Firefox (what a nightmare).

Unless I change the xml version to 1.0 Firefox will present the following output:

I've changed the version to 1.0.

Thanks.

/jpo

comment:9 in reply to:  7 Changed 16 years ago by anonymous

Replying to oneirist: ...[SNIP]...

Unless I change the xml version to 1.0 Firefox will present the following output:

I've changed the version to 1.0.

Hi,

I'm wondering if you committed the change as the online repository still has the xml 1.1 template (http://trac-hacks.org/browser/detailedrssfeedplugin/ReportToDetailedRSS/templates/).

/jpo

comment:10 Changed 16 years ago by nikolaus

No, the change hadn't been committed; sorry about that.

It's committed now, along with a BSD license. I also changed the content-type in the way you specified.

comment:11 in reply to:  10 Changed 16 years ago by anonymous

Resolution: fixed
Status: assignedclosed

Replying to oneirist:

No, the change hadn't been committed; sorry about that.

It's committed now, along with a BSD license. I also changed the content-type in the way you specified.

Thanks for releasing version 1.0.1. Firefox no longer complains with this version.

/jpo

PS - I have made a specfile for your plugin. I can upload it if you are interested in producing RPMS.

comment:12 Changed 16 years ago by nikolaus

Sure, go for it. I've never rolled an RPM before but I'm willing to try.

Changed 16 years ago by anonymous

Specfile for the plugin. Tested in CentOS 5.x.

comment:13 in reply to:  12 Changed 16 years ago by anonymous

Replying to oneirist:

Sure, go for it. I've never rolled an RPM before but I'm willing to try.

Hi,

The specfile was tested in CentOS 5.2 but should also build correctly in Fedora.

Steps to build RPMS in a non-root account:

   $ cd
   $ mkdir -p rpms/{BUILD,SOURCES,SPECS,SRPMS,RPMS/{i386,x86_64,noarch}}
   $ echo "%_topdir  $HOME/rpms" > ~/.rpmmacros
   $ cd rpms/SOURCES
   $ wget -N -c "http://trac-hacks.org/changeset/latest/detailedrssfeedplugin?old_path=/&filename=detailedrssfeedplugin&format=zip"
   $ cd ../SPECS
   $ wget -N -c "http://trac-hacks.org/raw-attachment/ticket/3541/trac-detailedrssfeed-plugin.spec"
   $ rpmbuild -ba trac-detailedrssfeed-plugin.spec

/jpo

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:14 Changed 16 years ago by anonymous

I don't have rpmbuild because I've got OS X, unfortunately.

Modify Ticket

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