Opened 8 years ago

Closed 8 years ago

# Feed is always empty

Reported by: Owned by: FilipeCorreia oneirist normal DetailedRssFeedPlugin normal FilipeCorreia 0.11

### Description

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

### comment:1 follow-up: ↓ 4 Changed 8 years ago by oneirist

• Status changed from new to assigned

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 8 years ago by anonymous

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

@@ -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"?>
xmlns:xi="http://www.w3.org/2001/XInclude">

### comment:4 in reply to: ↑ 1 ; follow-up: ↓ 5 Changed 8 years ago by 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 ; follow-up: ↓ 7 Changed 8 years ago by anonymous

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

@@ -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
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
Line Number 1, Column 16:<?xml version="1.1"?>
---------------^

Patch:

@@ -1,4 +1,4 @@
-<?xml version="1.1"?>
+<?xml version="1.0"?>
xmlns:xi="http://www.w3.org/2001/XInclude">

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 8 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 ; follow-ups: ↓ 8 ↓ 9 Changed 8 years ago by oneirist

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:

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 8 years ago by 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:

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:

----------

• 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

200 OK

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 8 years ago by anonymous

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 follow-up: ↓ 11 Changed 8 years ago by oneirist

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 8 years ago by anonymous

• Resolution set to fixed
• Status changed from assigned to closed

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 follow-up: ↓ 13 Changed 8 years ago by oneirist

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

### Changed 8 years ago by anonymous

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

### comment:13 in reply to: ↑ 12 Changed 8 years ago by anonymous

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"

/jpo

Last edited 3 years ago by rjollos (previous) (diff)

### comment:14 Changed 8 years ago by anonymous

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