Closed
Description
Steps to reproduce
- Install Magento from
develop
branch. - load a CMS Page through
$model = $pageRepository->getById(1);
- modify the last update timestamp:
$model->setUpdateTime('2016-09-01 00:00:00');
- save through
$pageRepository->save($model);
Expected result
- the
cms_page
database columnupdate_time
of entity 1 contains2016-09-01 00:00:00
Actual result
- the database column "update_time" contains the old value
the reason being in Magento\Framework\EntityManager\Db\UpdateRow:prepareData
:
foreach ($connection->describeTable($metadata->getEntityTable()) as $column) {
if ($column['DEFAULT'] == 'CURRENT_TIMESTAMP' || $column['IDENTITY']) {
continue;
}
as the column update_time has the default value CURRENT_TIMESTAMP
, the field is not appended to the $output
array.
please note: i'm aware that cms_page.update_time
is auto-updated through mysql's "on update" attribute, I'm merely using this existing model as an example that can be easily reproduced without having to write tons of code.