-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sitemap.xml: lastmod timestamp can contain invalid dates #9151
Comments
IMHO setting Back to the issue in question, a negative date value is something new 🤣 |
@hostep, thank you for your report. |
@magento-engcom-team: can you point me to the commit which fixes this, since I don't see it? I think you are talking about issue 10598 which is not the same as this one :) |
The issue has been fixed in 2.2-develop branch. Will be available with 2.2.2 release |
Hi @hostep. Thank you for your report.
The fix will be available with the upcoming 2.3.0 release. |
Preconditions
Steps to reproduce
created_at
timestamp is a valid date, and theupdated_at
timestamp is0000-00-00 00:00:00
I don't think you can manage this by manually creating a category in the backend of Magento, but we managed to have some categories like this by importing them using a custom PHP script.
Expected result
lastmod
value in the xml should contain thecreated_at
timestampActual result
lastmod
value in the xml looks like this:The negative value is most likely caused by our timezone setting:
Europe/Brussels
.Possible solution
Discussion
I'm not sure if this is an actual bug in Magento, due to the fact that we inserted some data in the database in a possibly incorrect way.
Also: what should happen when the
created_at
timestamp contains '0000-00-00 00:00:00'? In that case thelastmod
field shouldn't appear I assume, since it is optional: https://www.sitemaps.org/protocol.html#xmlTagDefinitionsIf somebody could let me know what the best solution would be in this case, I can create a pull request for this.
If it is decided that this isn't an actual bug, then we should fix our custom import code I guess.
Please let me know, thanks! :)
The text was updated successfully, but these errors were encountered: