Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50392 closed defect (bug) (fixed)

set-screen-option hook broken in 5.4.2

Reported by: sswells's profile sswells Owned by: whyisjake's profile whyisjake
Milestone: 5.4.3 Priority: normal
Severity: normal Version: 5.4.2
Component: Administration Keywords: has-patch fixed-major
Focuses: Cc:

Description

A value returned using the set-screen-option hook is being ignored. Take a look.

Line 711: $value = apply_filters( 'set-screen-option', false, $option, $value );
Line 730: $value = apply_filters( "set_screen_option_{$option}", false, $option, $value );

Line 730 should be:
apply_filters( "set_screen_option_{$option}", $value );

Attachments (2)

50392.diff (527 bytes) - added by SergeyBiryukov 4 years ago.
50392.2.diff (1.3 KB) - added by Chouby 4 years ago.

Download all attachments as: .zip

Change History (33)

#1 @whyisjake
4 years ago

  • Owner set to whyisjake
  • Status changed from new to accepted

@SergeyBiryukov
4 years ago

#2 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.4.3

#3 @SergeyBiryukov
4 years ago

  • Keywords has-patch added

Hi there, welcome back to WordPress Trac!

Good catch, thanks for the report. I think the preferred fix here would be to return after set-screen-option if the value is unchanged, same as before 5.4.2. See 50392.diff.

#4 @SergeyBiryukov
4 years ago

As a workaround until the issue is fixed, I'd recommend switching to the newer set_screen_option_{$option} filter, which should work as expected.

#5 follow-up: @SergeyBiryukov
4 years ago

  • Keywords has-patch removed

Just realized 50392.diff still won't work as expected. Will take another look.

#6 @SergeyBiryukov
4 years ago

#50432 was marked as a duplicate.

@Chouby
4 years ago

#7 in reply to: ↑ 5 ; follow-up: @Chouby
4 years ago

Replying to SergeyBiryukov:

Just realized 50392.diff still won't work as expected. Will take another look.

I propose you this new patch 50392.2.diff
As the issue was introduced by 5.4.2, I suppose that it's present in all minor versions updated at the same time. Am I right?

Last edited 4 years ago by Chouby (previous) (diff)

This ticket was mentioned in Slack in #core by whyisjake. View the logs.


4 years ago

This ticket was mentioned in Slack in #forums by joyously. View the logs.


4 years ago

#10 @Chouby
4 years ago

  • Keywords has-patch added

#11 in reply to: ↑ 7 @SergeyBiryukov
4 years ago

Replying to Chouby:

I propose you this new patch 50392.2.diff

That looks good, thanks!

As the issue was introduced by 5.4.2, I suppose that it's present in all minor versions updated at the same time. Am I right?

Yes, the fix would need to be backported to all the branches starting with 3.7.

#12 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 48241:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Props Chouby, sswells, SergeyBiryukov.
Fixes #50392.

#13 @SergeyBiryukov
4 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backports.

#14 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 48244:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 5.4 branch.
Fixes #50392.

#15 @SergeyBiryukov
4 years ago

In 48245:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 5.3 branch.
Fixes #50392.

#16 @SergeyBiryukov
4 years ago

In 48246:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 5.2 branch.
Fixes #50392.

#17 @SergeyBiryukov
4 years ago

In 48247:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 5.1 branch.
Fixes #50392.

#18 @SergeyBiryukov
4 years ago

In 48248:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 5.0 branch.
Fixes #50392.

#19 @SergeyBiryukov
4 years ago

In 48249:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.9 branch.
Fixes #50392.

#20 @SergeyBiryukov
4 years ago

In 48250:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.8 branch.
Fixes #50392.

#21 @SergeyBiryukov
4 years ago

In 48251:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.7 branch.
Fixes #50392.

#22 @SergeyBiryukov
4 years ago

In 48252:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.6 branch.
Fixes #50392.

#23 @SergeyBiryukov
4 years ago

In 48253:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.5 branch.
Fixes #50392.

#24 @SergeyBiryukov
4 years ago

In 48254:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.4 branch.
Fixes #50392.

#25 @SergeyBiryukov
4 years ago

In 48255:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.3 branch.
Fixes #50392.

#26 @SergeyBiryukov
4 years ago

In 48256:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.2 branch.
Fixes #50392.

#27 @SergeyBiryukov
4 years ago

In 48257:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.1 branch.
Fixes #50392.

#28 @SergeyBiryukov
4 years ago

In 48258:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 4.0 branch.
Fixes #50392.

#29 @SergeyBiryukov
4 years ago

In 48259:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 3.9 branch.
Fixes #50392.

#30 @SergeyBiryukov
4 years ago

In 48260:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 3.8 branch.
Fixes #50392.

#31 @SergeyBiryukov
4 years ago

In 48261:

Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.

Rename the $keep parameter of both filters to $screen_option for clarity, update the documentation to better reflect its purpose.

Follow-up to [47951].

Props Chouby, sswells, SergeyBiryukov.
Merges [48241] to the 3.7 branch.
Fixes #50392.

Note: See TracTickets for help on using tickets.