Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8152 closed defect (fixed)

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

Reported by: stava@… Owned by: martin_s
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 stava 4 years ago.
Datetime format fix.

Download all attachments as: .zip

Change History (7)

comment:1 in reply to: ↑ description Changed 4 years ago by stava@…

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 follow-up: Changed 4 years ago by martin_s

  • Status changed from new to assigned

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 4 years ago by stava

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 4 years ago by stava

Datetime format fix.

comment:4 Changed 4 years ago by martin_s

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

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

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

comment:5 follow-up: Changed 4 years ago by 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

comment:6 in reply to: ↑ 5 Changed 4 years ago by stava

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from martin_s. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.