-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support dateCreated and dateCreated attributes when saving through code #2909
Comments
Those are meant to be more like audit attributes that our base ActiveRecord class sets automatically (and doesn’t even give the outside code a choice on their values), so this isn’t something we could change without making a pretty significant change to ActiveRecord behavior. So if you really want to hard-set those values, you’d have to either create the element rows manually, or let the Elements service continue doing the initial work, and then go in and update their values after the fact. (Note that for both |
Alright no worries |
I ended up having a need for this, so have implemented it on the |
cms/src/elements/Entry.php
Line 1018 in fc9365c
We have an importing feature in our plugin that allows user to set dateCreated and dateUpdated on newly imported entries but the
afterSave
method on Entry class does not pass the dateCreated and dateUpdated values on the record class. This prevents it from saving the dateCreated and dateUpdated values that has been set.The text was updated successfully, but these errors were encountered: