magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

updated_at not changing on mass update attributes.

Open tzyganu opened this issue 12 years ago • 12 comments

This is inspired by a question for Magento 1.
I tested on Magento 2-alpha 104 and it behaves the same as in Magento 1.
When mass updating products using the Update attributes from the product admin grid, the updated_at attribute does not change.
It is only changed when explicitly calling $product->save().
This may be a philosophical question "Should updated_at be changed when bulk updating products?".
I would say "Yes". It should be changed independent of the source of the modification.
This is applicable for all EAV entities.
If you have a different view on the issue, please share.

tzyganu avatar Nov 21 '14 12:11 tzyganu

Thanks for this suggestion, @tzyganu! We will consider this when improving the way Magento 2 behaves.

verklov avatar Dec 09 '14 07:12 verklov

Internal ticket: MAGETWO-31537

vpelipenko avatar Jan 29 '15 13:01 vpelipenko

We're currently validating an extension for Magento 2 where we have a products api sync and this issue is causing us to miss data. I hope to resurrect the ticket (it's almost a year since it's been "acknowledged", and as of 2.0.2 there is no change.

We are considering adding a observer to the update action, and set the updated_at for all the affected products, but as it will be hacky, we'd rather have it part of the product.

pavlindrom avatar Feb 10 '16 16:02 pavlindrom

+1

miguelbalparda avatar Feb 10 '16 19:02 miguelbalparda

I would agree with @tzyganu that the updated_at field should get updated regardless of the source of the change.

erikhansen avatar Feb 11 '16 01:02 erikhansen

Any updates on this issue? The updated_at column should get updated if you change details about a product, etc. Surely this is an oversight?

gtaylor44 avatar Jul 04 '16 03:07 gtaylor44

+1

samtay avatar Jul 14 '16 16:07 samtay

@tanya-soroka @vkorotun Product updated_at not changing also on price change.

Magento: CE2.0.1

RUjmiak avatar Aug 22 '16 09:08 RUjmiak

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

piotrekkaminski avatar Aug 30 '16 20:08 piotrekkaminski

Hello

I am on Magneto 2.1.2 and facing same issue , like if we update products by mass update or even single it dont change updated_at in db

sajidunnar avatar Nov 08 '16 15:11 sajidunnar

Hello, We are using Magento 2.3.3 and faced this behavior. IMO, this is a bug not an improvement. updated_at is a system feature that should reliably and accurately record the date and time an object is updated, assuming it is not done by an SQL query. By allowing either update attributes or update status features in the admin to not change this timestamp, it defeats the integrity of the data and developers/administrators cannot rely at all on the field.

As an example, the merchandising department is wanting to know why the product is marked disabled when it should be active, however we cannot even tell when the change was made. I tested and verified that the date and time was not updated - as if it wasn't updated at all. Every other enterprise system that I work with has a reliable method of updating the date and time if the feature exists.

aliomattux avatar Jan 25 '21 20:01 aliomattux

I'm in a similar predicament and thinking of adding db triggers for this e.g. but for every eav table required

CREATE TRIGGER trg_update_catalog_product_entity_updated_at
AFTER INSERT ON db_live.catalog_product_entity_decimal
FOR EACH ROW
BEGIN
    UPDATE db_live.catalog_product_entity
    SET updated_at = CURRENT_TIMESTAMP()
    WHERE entity_id = NEW.entity_id;
END;

I'm curious to what others have tried for fixing this issue. @aliomattux did you manage to fix it in your case?

ioweb-gr avatar Jul 11 '23 06:07 ioweb-gr