Loading...
 
Features / Usability

Features / Usability


Sitemap with wrong lastmod-tag

posts: 32 Germany

Hey there,

in the Sitemap are wrong dates for the lastmod-tag.

Most of the data shows:
1970-01-01T00:00:00+00:00

Copy to clipboard
<lastmod>1970-01-01T00:00:00+00:00</lastmod>


Some others something like this:
4067-04-06T16:39:47+00:00

Copy to clipboard
<lastmod>4067-04-06T16:39:47+00:00</lastmod>


Any idea, how to fix that?

Tanks

Bob

posts: 8633 Israel
Bob wrote:

Hey there,

in the Sitemap are wrong dates for the lastmod-tag.

Most of the data shows:
1970-01-01T00:00:00+00:00

Copy to clipboard
1970-01-01T00:00:00+00:00


Some others something like this:
4067-04-06T16:39:47+00:00

Copy to clipboard
4067-04-06T16:39:47+00:00


Any idea, how to fix that?

Tanks

Bob


Hello Bob,

Please gives us minimum details so we can help. (Tiki version, server used, what, where...) 🤷🏻‍♂️

Here on Tiki25, using the Tiki sitemap featureon a Debian11/Apache server dates are correct.

May be something with your version or server setup ?

posts: 32 Germany
Bernard Sfez / Tiki Specialist wrote:

Hello Bob,

Please gives us minimum details so we can help. (Tiki version, server used, what, where...) 🤷🏻‍♂️

Here on Tiki25, using the Tiki sitemap featureon a Debian11/Apache server dates are correct.

May be something with your version or server setup ?


Hello,

Tiki version: 24.0
phpinfo:
System Linux server.cpprotect3.de 3.10.0-962.3.2.lve1.5.56.el7.x86_64 #1 SMP Thu May 27 10:10:44 UTC 2021 x86_64
MySQL 5.7.41-cll-lve

I use the tiki-admin_sitemap.php to generate the xml file.

In what DB-table are these dates stored?

If found the "tiki_pages" table with the "lastModif" field. Is this the correct field? If so, what format is used here? So I can check if it is correct in the DB. Looks like a unix-timestamp?

Thank you.

posts: 8633 Israel
Bob wrote:
Tiki version: 24.0


I have limited skills about server administration but Tiki24.0 was outputting the date on my several sitemaps correctly. Supposing your database was created using Tiki install, it should be correct and I wouldn't try to modify it.

I would look at time encoding on the MySQL level or the server.

Look at http://yourdomain.com/tiki-check.php you may found key to your problem. 😉

posts: 32 Germany
Bernard Sfez / Tiki Specialist wrote:

I have limited skills about server administration but Tiki24.0 was outputting the date on my several sitemaps correctly. Supposing your database was created using Tiki install, it should be correct and I wouldn't try to modify it.

I would look at time encoding on the MySQL level or the server.

Look at http://yourdomain.com/tiki-check.php you may found key to your problem. 😉


The tiki-check.php look ok. All time stuff look good for me, but I don't realy know where and what.

In tiki-listpages.php there are the correct dates.

Manual modification in the tiki_page.lastModif field to 0 shows the current date in the sitemap! I expected here the 1970 date.


My solution:

\vendor_bundled\vendor\melbahja\seo\src\Sitemap\SitemapBuilder.php

Copy to clipboard
protected function pasreDate($date): string { if (is_int($date) === false) { //$date = strtotime($date); } return date('c', $date); }


I "disabled" the if statement.

I have no idea, where the data for $date come from. And why should it not be an INT value like in the DB?

posts: 1 Democratic Republic of the Congo
Bob wrote:

Hello,

Tiki version: 24.0
phpinfo:
System Linux server.cpprotect3.de 3.10.0-962.3.2.lve1.5.56.el7.x86_64 #1 SMP Thu May 27 10:10:44 UTC 2021 x86_64
MySQL 5.7.41-cll-lve

I use the tiki-admin_sitemap.php to generate the xml file.

In what DB-table are these dates stored?

If found the "tiki_pages" table with the "lastModif" field. Is this the correct field? If so, what format is used here? So I can check if it is correct in the DB. Looks like a unix-timestamp?

Thank you.


please update your tiki from version 24.0 to 24.3 we have already fixed this problem. the commit link is: https://gitlab.com/tikiwiki/tiki/-/merge_requests/1843
Thank you.