Opened 4 years ago
Last modified 14 months ago
#48393 accepted enhancement
Fix from #38903 prevents options autoload parameter update
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | major | Version: | |
Component: | Options, Meta APIs | Keywords: | 2nd-opinion needs-patch |
Focuses: | administration | Cc: |
Description
This is a follow-up to #38903.
3 years ago fix for not * If the new and old values are the same, no need to update. * But this condition does not check if method call intention was to update autoload field of the option.
Currently the issue can be resolved by force update options when update_option method is called with autoload != null and check * If the new and old values are the same, no need to update. * should be skipped.
Change History (10)
#2
follow-up:
↓ 4
@
2 years ago
I'd disagree with the wontfix
.
While it's there in the documentation it's most definitely counter-intuitive and, perhaps more importantly, there's no alternate direct function to change an options' autoload
property.
This currently means that in order to change the autoload
property of an option developers are forced to resort to direct $wpdb
calls which shouldn't be necessary for something so simple.
I think changing update_option
so that autoload
is updated even if the value is unchanged would be by far the most intuitive and elegant way of doing things. Of course if neither the value nor the autoload
property have been changed then nothing should happen.
#3
@
2 years ago
We just ran into this because @herregroen was fixing some of my code in which I was (wrongly) assuming that update_option
would work to change an option's autoload value... So I disagree with the wontfix
and would suggest making it so this is doable.
#4
in reply to:
↑ 2
@
2 years ago
- Keywords needs-patch added; close removed
- Milestone changed from Awaiting Review to 5.8
- Owner set to SergeyBiryukov
- Status changed from new to accepted
Replying to herregroen:
I think changing
update_option
so thatautoload
is updated even if the value is unchanged would be by far the most intuitive and elegant way of doing things. Of course if neither the value nor theautoload
property have been changed then nothing should happen.
I tend to agree.
This ticket was mentioned in Slack in #core by chaion07. View the logs.
2 years ago
#6
@
2 years ago
- Milestone changed from 5.8 to 5.9
This one needs more time for a proper patch and amount of testing. If it moves forwards, we should also communicate it clearly and early to developers.
I wouldn't be surprised if there are some strange edge cases where developers include the autoload
in their code and it continues working only because that argument had no affect previously.
#7
@
19 months ago
- Milestone changed from 5.9 to 6.0
With 5.9 Beta 1 tomorrow and no activity on this ticket in this cycle, moving to 6.0 for further discussion and consensus.
This ticket was mentioned in Slack in #core by costdev. View the logs.
14 months ago
#9
@
14 months ago
Per the discussion in the bug scrub, pinging @SergeyBiryukov to see if this ticket is still on your radar?
#10
@
14 months ago
- Milestone changed from 6.0 to Future Release
- Type changed from defect (bug) to enhancement
Bumping this from 6.0 as there hasn't been any activity for this cycle. It's too late to get a breaking change suitably patched, reviewed, etc before the beta.
I've changed the ticket type to enhancement as the change been discussed here is documented and was discussed in #26394.
Thanks for this ticket, @aboltro. And welcome to Trac!
This looks to be an intentional decision. #26394, and more specifically 26394#comment:13/[31640] shed more light. This behavior is also explicitly documented in the inline documentation.
I am going to recommend this be closed as a
wontfix
. But also marking for a second opinion.