[wp-trac] [WordPress Trac] #47083: Site Info Update Not Adjusting "Last Updated" Value
WordPress Trac
noreply at wordpress.org
Thu May 9 17:14:48 UTC 2019
#47083: Site Info Update Not Adjusting "Last Updated" Value
--------------------------------+------------------------------
Reporter: conner_bw | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 5.1.1
Severity: normal | Resolution:
Keywords: | Focuses: multisite
--------------------------------+------------------------------
Comment (by tmdesigned):
I think you misunderstood me. I did not disagree that there was a code
behavior change.
The change was not because those lines were removed, though. It does still
calculate the current time using the same exact 2 lines of code (moved
elsewhere), but now it only uses it as a default for when a value isn't
provided. A value **is** provided from the form when editing a single
site, so the "default" isn't used.
Allowing a user to submit an arbitrary "last updated" value is a little
odd no matter how you think about it. Some options:
1) Always update the {{{last_updated}}} value to the current time,
ignoring what the user may have typed into the form, thereby reverting to
the pre-5.1 behavior. If this is done, I would recommend removing it as a
value from the form altogether and not displaying it in an input box,
since that implies you can edit it.
2) Change the bulk edit function to not update the last_updated value.
This seems like the least favorable solution, since it is in fact now
edited.
3) On the single site update form, compare the submitted "last edited"
value to the existing (previous) value. If they are the same, meaning the
user did not edit the input box, update the time to the present.
The third is more flexible, but has the odd effect that if for some reason
I wanted the last updated time to stay exactly the same, I'd have to first
change it to something else (or let it update automatically) and then
change it back. Perhaps to address this there is a 4th option
4) Add a checkbox field, "Update to current date and time", that defaults
to being checked. If checked, the new calculated datetime can be used. If
unchecked, whatever is in the form (which starts as the previously saved
value) will be used. Uncheck the box automatically if the user changes the
value in the input box.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47083#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list