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
Inconsistent behaviour resaving elements #1345
Comments
Thanks for reporting this has been fixed in da8d20b which will be out this week in Commerce 3.1 |
@lukeholder I'm not sure if da8d20b resolves the issue. Removing the |
The Do you mean the If so, that command specifically does not make changes to the elements My change (da8d20b ) means that we never use the Having said that I can see it is a little confusing to see the dates as different in the DB and when using the I you want to fix them on mass, you would need to write your own SQL command to update them. Something like?: UPDATE craft_commerce_orders orders
INNER JOIN craft_elements elements
ON orders.id = elements.id
SET orders.dateUpdated = elements.dateUpdated Confirm the dates are the same with: SELECT orders.dateUpdated orderDate, elements.dateUpdated elementDate, elements.id
FROM craft_commerce_orders orders
INNER JOIN craft_elements elements
ON elements.id = orders.id This will be included in the next release. Thanks. |
Description
Orders resave action doesn't update
elements.dateUpdated
, but updatesorders.dateUpdated
. Therefore using the.dateUpdated()
filter can cause orders to be removed from the result set if there's orders which have been resaved using./craft resave/orders
.Resaving entries does not update the dateUpdated field in either table.
It's not clear whether dateUpdated should be updated on resave for all elements (which would probably put this as a cms bug), or whether the orders resave is updating incorrectly.
Steps to reproduce
./craft resave/orders --element-id 25
and rerun the query and observe that only theorders.dateUpdated
field has changed:Additional info
The missing results are due to the dateUpdated filter being applied to both
orders
andelements
tables:The text was updated successfully, but these errors were encountered: