WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#35057 closed defect (bug) (fixed)

bug in new default_hidden_columns filter

Reported by: dwenaus Owned by: helen
Milestone: 4.4.1 Priority: normal
Severity: normal Version: 4.4
Component: Administration Keywords: has-patch commit
Focuses: administration Cc:

Description

This is a follow-up to #32499.

In the function get_hidden_columns() the simple test to see if the user has hidden columns or not is
if ( ! $hidden ) {
however that also happens when the user has chosen to show all columns, it's and empty array.
better would be
if ( $hidden === false ) {
that way the default_hidden_columns filter will only fire if the user option does not exist at all.

Attachments (3)

35057.diff (390 bytes) - added by voldemortensen 5 years ago.
35057.1.diff (1.8 KB) - added by Compute 5 years ago.
35057.2.diff (928 bytes) - added by jorbin 5 years ago.

Download all attachments as: .zip

Change History (17)

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 4.4.1

@voldemortensen
5 years ago

#2 @voldemortensen
5 years ago

  • Keywords has-patch needs-testing added

#3 @jorbin
5 years ago

  • Owner set to helen
  • Status changed from new to assigned

@helen, @Compute, @MikeHansenMe, @chriscct7 - This is a followup to [33689] which you all worked on, can you please take a look at the patch and comment with your thoughts?

#4 @MikeHansenMe
5 years ago

@voldemortensen patch looks good to me. Now an empty array would return false and skip the filter.

#5 @Compute
5 years ago

Guess it would make sense to check for false. Either that, or do the same as the get_hidden_meta_boxes function is doing:

	$use_defaults = ! is_array( $hidden );
	// Hide slug boxes by default
	if ( $use_defaults ) {
	...

Either way I really think that both get_hidden_meta_boxes() and get_hidden_columns() should use the same method for consistency.

@Compute
5 years ago

#6 @jorbin
5 years ago

I like the idea of using the same method we are using elsewhere.

A few small notes on your patch @Compute:

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


5 years ago

#8 @helen
5 years ago

I'm assuming that only the first chunk of the patch is applicable and the second is formatting changes that shouldn't go in right now. I'm not all that excited about adding a param in a point release, but it seems okay. The docblock needs to be corrected from the copy-paste, though.

@jorbin
5 years ago

#9 @jorbin
5 years ago

  • Keywords commit added; needs-testing removed

While I also am hesitant to add a param in a point release, it is a new filter which means not including it is more of a bug than an enhancement.

New patch added without the formatting changes.

#10 @dd32
5 years ago

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

In 36154:

List Tables: When a user has hidden all columns, do not override that with the default_hidden_columns filter.

Props Compute, jorbin, voldemortensen.
Fixes #35057

#11 @dd32
5 years ago

In 36155:

List Tables: When a user has hidden all columns, do not override that with the default_hidden_columns filter.

Merges [36154] to the 4.4 branch.
Props Compute, jorbin, voldemortensen.
Fixes #35057.

#12 @ocean90
5 years ago

In 36156:

Docs: Remove indentation from the hidden_columns changelog entry.

Added in [36154].

See #35057.

#13 @cookigabry
5 years ago

I don't know if this is the right thread for me, since I upgraded WP to 4.4 and 4.4.1 below, the plugin Advanced WP columns is not responsive, you do not see the two columns on the page as before, lately I updated Genesis framework to version 2.2.6, I asked the question even the developer of the plugin, but I had no answer. the mobile version you view one column not aligned , the same desktop view, only that in desktop if I reduce a point zoom reappear the two columns

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


3 years ago

Note: See TracTickets for help on using tickets.