Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33684 closed enhancement (fixed)

Cheatin' uh?: Update in wp-includes/class-wp-customize-manager.php

Reported by: kraftbj's profile kraftbj Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: has-patch
Focuses: ui Cc:


Spin off of #14530 to track updating the Cheatin error message to something context specific. Patch needs to be split off of original ticket.

Attachments (3)

33684.diff (1.5 KB) - added by kraftbj 9 years ago.
initial patch
Screen Shot 2015-09-02 at 17.23.24.png (11.2 KB) - added by kraftbj 9 years ago.
sample of the dynamic error response.
33684.2.diff (1.6 KB) - added by kraftbj 9 years ago.
add translation functions

Download all attachments as: .zip

Change History (12)

9 years ago

initial patch

#1 @kraftbj
9 years ago

  • Keywords has-patch added

This file has a custom wp_die handler, so I applied the logic and spirit of #14530 like this:

  • "Upstream" from the actual wp_die call, I added error messages to each instance of the class' wp_die function.
  • For the generic theme error return, I used $this->theme()->errors()->get_error_message(). To follow the chain, the class' theme() calls wp_get_theme, which is a WP_Theme object. WP_Theme::errors() returns the WP_Error object, so get_error_message returns the pretty error message.

An example to test that error message:

  1. WordPress install with multiple themes installed. Access the Customizer. Preview theme A.
  2. From another window, delete theme B.
  3. From the original window, attempt to Live Preview theme A.

The result will be the attached screenshot.

9 years ago

sample of the dynamic error response.

#2 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.4

#3 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 33889:

Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-includes/class-wp-customize-manager.php.

props kraftbj.
fixes #33684. see #14530.

#4 @GaryJ
9 years ago

Do wp_die() messages need to be translatable? If we're going to be giving messages that pertain to being more useful to the user that caused them, then being able to have those messages in the user's desired language has got to be a necessity?

#5 @GaryJ
9 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening, as I've now seen that sibling commits do indeed have translatable strings, which simply got missed for this ticket.

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

9 years ago

#7 @kraftbj
9 years ago

The upstream error messages should already be translated, but I did overlook that when adding these. Patch incoming.

9 years ago

add translation functions

#8 @kraftbj
9 years ago

  • Keywords has-patch added; needs-patch removed

#9 @SergeyBiryukov
9 years ago

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

In 33892:

Add missing translation functions to the error messages added in [33889].

props kraftbj, GaryJ.
fixes #33684.

Note: See TracTickets for help on using tickets.