Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#23068 closed defect (bug) (duplicate)

default selected image size is updated too aggressively

Reported by: leedo's profile leedo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords:
Focuses: Cc:

Description

When inserting a small image (smaller than the smallest custom image size) the only size option is "Full Size". This is expected, but what is not expected is that inserting the Full Size image updates the user's image size preference to Full Size. So the next time the page is refreshed the selected size for all images in the media popup is Full Size.

Since upgrading to WP 3.5 I have had a number of reports from authors speculating on how/why the default selected image size keeps changing. But what I described above seems to be the cause. In our situation, being able to specify a default image size for all users would be ideal (ignoring any cookied image size preferences.)

Change History (8)

#1 @leedo
12 years ago

  • Summary changed from default image size is updated too aggressively to default selected image size is updated too aggressively

#2 @jond3r
12 years ago

  • Cc jond3r@… added

This behavior was caused by the resolution of #22693.

#3 @nacin
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This doesn't sound like a regression. The behavior fixed up in #22693 was emulating 3.4 behavior of remembering the previously used size.

If image cropping is involved, perhaps this is #22985.

Looking again at the code surrounding the old options, it seems like these (accidentally?) overrode the previously used size as stored per-user. See #22841 for the bug report. I have a feeling this is the issue (you can confirm by checking the wp_options value for image_default_size), so closing as a duplicate of this.

#4 follow-up: @leedo
12 years ago

In my mind, the real issue is that the user isn't explicitly selecting Full Size, but it is becoming the default for future images. They're using Full Size without any extra interactions because it is the only size available for the image. In our case it is very rare that we actually want to insert a Full Size image, and it's only ever used if the image is smaller than all the image sizes.

Our image_default_size was not set, but setting seems to have no effect overriding the per-user preference that is being set. I don't see any way to work around this issue as things are, so any hints would be helpful.

#5 in reply to: ↑ 4 @nacin
12 years ago

Replying to leedo:

In my mind, the real issue is that the user isn't explicitly selecting Full Size, but it is becoming the default for future images. They're using Full Size without any extra interactions because it is the only size available for the image. In our case it is very rare that we actually want to insert a Full Size image, and it's only ever used if the image is smaller than all the image sizes.

This seems to be the same behavior as 3.4. Please correct me if I am wrong.

Our image_default_size was not set, but setting seems to have no effect overriding the per-user preference that is being set. I don't see any way to work around this issue as things are, so any hints would be helpful.

That part is a bug, see #22841.

#6 follow-up: @nacin
12 years ago

leedo: You said "our image_default_size was not set". Does this mean it was in the database but empty, or not in the database at all? This distinction is important and plays into #22841.

#7 in reply to: ↑ 6 ; follow-up: @leedo
12 years ago

Replying to nacin:

Replying to leedo:

In my mind, the real issue is that the user isn't explicitly selecting Full Size, but it is becoming the default for future images. They're using Full Size without any extra interactions because it is the only size available for the image. In our case it is very rare that we actually want to insert a Full Size image, and it's only ever used if the image is smaller than all the image sizes.

This seems to be the same behavior as 3.4. Please correct me if I am wrong.

In my limited testing this does not seem to be the case.

In 3.4, with a per-user image preference of Medium, if I insert an image with only Full Size available (auto-selected), my user preference remains Medium. However, if I *click* Full Size (even if it is already selected) my user preference is updated to Full Size.

Hope that makes sense. :)

Replying to nacin:

leedo: You said "our image_default_size was not set". Does this mean it was in the database but empty, or not in the database at all? This distinction is important and plays into #22841.

The image_default_size did exist in the database, but the value was empty.

#8 in reply to: ↑ 7 @nacin
12 years ago

Replying to leedo:

In 3.4, with a per-user image preference of Medium, if I insert an image with only Full Size available (auto-selected), my user preference remains Medium. However, if I *click* Full Size (even if it is already selected) my user preference is updated to Full Size.

Hope that makes sense. :)

It does, thank you! I've added that note onto #22841. We can continue this all there.

Note: See TracTickets for help on using tickets.