-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Backport 2.3] #12625: Add Current Date to update_time Field for Block and Pages #12637
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
801d407
to
336b5b2
Compare
This is a backport of #12636 |
@@ -126,6 +126,10 @@ protected function _beforeSave(AbstractModel $object) | |||
__('The page URL key cannot be made of only numbers.') | |||
); | |||
} | |||
|
|||
$date = (new \DateTime())->format(DateTime::DATETIME_PHP_FORMAT); |
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.
Please, use framework implementation for date value \Magento\Framework\Stdlib\DateTime\DateTime::date
336b5b2
to
71b139b
Compare
@sidolov Changes made, and added integration tests for Cms Block 😃 |
e91243e
to
29812aa
Compare
Hi @osrecio , i investigated this issue deeper and find that field 'update_time' should be automatically updated by Mysql engine. In db this field has type timestamp and must be automatically updated after row has been changed. We had the same issue with quote (bf9ea28).
|
29812aa
to
5cce625
Compare
Hi @sidolov I changed Models to add in method
Thanks for catch it, I made my life complicated changing Resource Model :) |
… Field for Block and Pages #12637
Set Current Date Time to update_time field
Description
add current date time to 'update_time' in
_beforeSave
method for Page and BlockFixed Issues (if relevant)
Manual testing scenarios
Contribution checklist