-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#9151: [Github] Sitemap.xml: lastmod timestamp can contain invalid dates #11902
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about the result of this PR compared to the issue request.
* | ||
* @var int | ||
*/ | ||
protected $lastModMinTsVal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a new property can we make it private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -661,7 +673,11 @@ protected function _getMediaUrl($url) | |||
*/ | |||
protected function _getFormattedLastmodDate($date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see in the discussion in #9151 the talked about solution would be to show The lastmod value in the xml should contain the created_at timestamp
was this changed at some point to show 0000-01-01 00:00:00
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dmanners
Magento should not be obliged to respond to incorrectly filled database fields through third-party code. But in the formation of sitemap we must take into account the case when the lastmod has zero value.
In the case of the #9151, the field "created_at" may also contain a zero value, and the issue remains.
So I decided that is the better solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update that has clarified it nicely.
Description
Allow only valid lastmod values in Sitemap
Fixed Issues
Manual testing scenarios
<lastmod>-001-11-30T00:00:00+00:00</lastmod>
<lastmod>0000-01-01T00:00:00+00:00</lastmod>
Contribution checklist