Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#8152 closed defect (fixed)

The essential "<lastmod>" tag is there but empty, thus Google refuses processing

Reported by: Lars Stavholm Owned by: Martin Scharrer
Priority: highest Component: GoogleSitemapPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description

The <lastmod> tag is present in the output, but with an empty value, thus no processing takes place at Google. Using Trac 0.12.1 with googlesitemapplugin/0.11 and Python 2.6.5. Nicer formatting of the output would also be appreciated (easier to debug). Sample sitemap.xml attached.

Attachments (1)

googlesitemapplugin.patch (1.3 KB) - added by Lars Stavholm 14 years ago.
Datetime format fix.

Download all attachments as: .zip

Change History (7)

comment:1 in reply to:  description Changed 14 years ago by Lars Stavholm

Replying to stava@linadd.org:

The <lastmod> tag is present in the output, but with an empty value, thus no processing takes place at Google. Using Trac 0.12.1 with googlesitemapplugin/0.11 and Python 2.6.5. Nicer formatting of the output would also be appreciated (easier to debug). Sample sitemap.xml attached.

Sorry, the spam filter prevented me from attaching the sitemap.xml. instead, have a look at http://www.linadd.org/addons/sitemap.xml.

comment:2 Changed 14 years ago by Martin Scharrer

Status: newassigned

Hi, thanks for reporting this issue. I have to check why this appears now. Maybe it's Trac 0.12. I will have a look on it this weekend.

Martin

comment:3 in reply to:  2 Changed 14 years ago by Lars Stavholm

Replying to martin_s:

Hi, thanks for reporting this issue. I have to check why this appears now. Maybe it's Trac 0.12. I will have a look on it this weekend.

I gave it a whirl and found that it was the call to _fixtime() that messed things up. I simply removed the call on lines 92 and 104, and that seems to do the trick. However, the _fixtime() calls were there for a reason that eludes me. I'll try to attach the patch, but the spam filter here might stop me.

Changed 14 years ago by Lars Stavholm

Attachment: googlesitemapplugin.patch added

Datetime format fix.

comment:4 Changed 14 years ago by Martin Scharrer

Resolution: fixed
Status: assignedclosed

(In [9514]) tracgooglesitemap/plugin.py::

Added missing else clause for _fixtime method. This should fix #8152.

comment:5 Changed 14 years ago by Martin Scharrer

Thanks for looking into it. This way it will be fixed much sooner because I don't have much time for debugging it myself at the moment.

The _fixtime method is required to ensure a colon between the hour and minute in the datetime string. Not all trac version, if any, include it, but Google requires it. There is an else clause missing, which results in an empty string if the colon is not missing or the datetime string is in Z (GMT) format.

I now added the missing else clause which should fix it. Could you please check if the new version [9514] works properly and reopen this ticket if not.

Thank you very much. Martin

comment:6 in reply to:  5 Changed 14 years ago by Lars Stavholm

Replying to martin_s:

Thanks for looking into it. This way it will be fixed much sooner because I don't have much time for debugging it myself at the moment.

The _fixtime method is required to ensure a colon between the hour and minute in the datetime string. Not all trac version, if any, include it, but Google requires it. There is an else clause missing, which results in an empty string if the colon is not missing or the datetime string is in Z (GMT) format.

I now added the missing else clause which should fix it. Could you please check if the new version [9514] works properly and reopen this ticket if not.

Thank you very much. Martin

Works nicely now. Cheers/Lars

Modify Ticket

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