Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41887 closed enhancement (fixed)

Code Editor: Error disables the Update File button.

Reported by: paaljoachim's profile paaljoachim Owned by: melchoyce's profile melchoyce
Milestone: 4.9 Priority: high
Severity: normal Version:
Component: General Keywords: ux-feedback needs-patch
Focuses: Cc:

Description

When there is an error in the code the Update File button is disabled.
It would be better to find another approach.

Such as giving a warning about saving the file etc... Leaving it up to the user to decide on saving the file.

Attachments (1)

update-despite-errors.png (483.4 KB) - added by melchoyce 7 years ago.

Download all attachments as: .zip

Change History (14)

This ticket was mentioned in Slack in #core-customize by paaljoachim. View the logs.


7 years ago

#2 @westonruter
7 years ago

  • Keywords ux-feedback added
  • Milestone changed from Awaiting Review to 4.9
  • Owner set to melchoyce
  • Status changed from new to assigned

There could be an “I understand” override checkbox similar to when supplying an insecure password. Or rather, instead of having a separate checkbox the error notification itself could simply be made dismissible, and once dismissed then the ability to save would be restored. This could be integrated into Custom CSS, Custom HTML widget, and file editor.

#3 @westonruter
7 years ago

  • Summary changed from Better Code Editing: Error disables the Update File button. to Code Editor: Error disables the Update File button.

#4 @westonruter
7 years ago

  • Priority changed from normal to high

Bumping priority to high for visibility and alignment with 4.9 goals, and given proximity to beta 1 deadline.

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


7 years ago

#6 @melchoyce
7 years ago

Let's disable save locking for CSS errors — the only way you're going to whitescreen your site is if you display:none everything, haha.

Working on an override design for php/js files.

#7 @jbpaul17
7 years ago

  • Keywords needs-patch added

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


7 years ago

#9 @melchoyce
7 years ago

update-despite-errors.png introduces a checkbox to toggle on saving.

Some notes:

  • When you click the checkbox, the disabled button becomes enabled.
  • Let's save this setting by default, so the next time someone makes an error the checkbox is already selected.
  • On smaller screens, the checkbox will wrap underneath the notice. The update button will wrap underneath that, so it goes Notice > Checkbox > Button.
  • I've changed "save" in the notice to "update this file," to match the label on the primary button.
  • The editor's been moved down a bit to give it some space between it and the header.
  • Likewise, I've moved down the template files in the right side of the screen so it lines up with the top of the editor.
  • I've also moved the documentation to the top of the screen, so it's not grouped with the update settings.

This ticket was mentioned in Slack in #core-customize by melchoyce. View the logs.


7 years ago

#11 @westonruter
7 years ago

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

In 41721:

File Editors: Introduce sandboxed live editing of PHP files with rollbacks for both themes and plugins.

  • Edits to active plugins which cause PHP fatal errors will no longer auto-deactivate the plugin. Supersedes #39766.
  • Introduce sandboxed PHP file edits for active themes, preventing accidental whitescreening of a user's site when introducing a fatal error.
  • After writing a change to a PHP file for an active theme or plugin, perform loopback requests on the file editor admin screens and the homepage to check for fatal errors. If a fatal error is encountered, roll back the edited file and display the error to the user to fix and try again.
  • Introduce a secure way to scrape PHP fatal errors from a site via wp_start_scraping_edited_file_errors() and wp_finalize_scraping_edited_file_errors().
  • Moves file modifications from theme-editor.php and plugin-editor.php to common wp_edit_theme_plugin_file() function.
  • Refactor themes and plugin editors to submit file changes via Ajax instead of doing full page refreshes when JS is available.
  • Use get method for theme/plugin dropdowns.
  • Improve styling of plugin editors, including width of plugin/theme dropdowns.
  • Improve notices API for theme/plugin editor JS component.
  • Strip common base directory from plugin file list. See #24048.
  • Factor out functions to list editable file types in wp_get_theme_file_editable_extensions() and wp_get_plugin_file_editable_extensions().
  • Scroll to line in editor that has linting error when attempting to save. See #41886.
  • Add checkbox to dismiss lint errors to proceed with saving. See #41887.
  • Only style the Update File button as disabled instead of actually disabling it for accessibility reasons.
  • Ensure that value from CodeMirror is used instead of textarea when CodeMirror is present.
  • Add "Are you sure?" check when leaving editor when there are unsaved changes.

Supersedes [41560].
See #39766, #24048, #41886.
Props westonruter, Clorith, melchoyce, johnbillion, jjj, jdgrimes, azaozz.
Fixes #21622, #41887.

#12 @westonruter
7 years ago

In 42171:

Customize: Allow notifications for linting errors in code editor control (for Additional CSS) to be overridden to allow saving.

Implements the same override that was implemented in [41721] for the theme/plugin editors.

See #41897, #41887.
Fixes #42528.

#13 @westonruter
7 years ago

In 42172:

Customize: Allow notifications for linting errors in code editor control (for Additional CSS) to be overridden to allow saving.

Implements the same override that was implemented in [41721] for the theme/plugin editors.

See #41897, #41887.
Fixes #42528 for 4.9.

Note: See TracTickets for help on using tickets.