WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 2 weeks ago

#53142 closed defect (bug) (fixed)

Add labels for permalink settings error textareas

Reported by: sabernhardt Owned by: joedolson
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-patch has-screenshots commit
Focuses: accessibility, administration Cc:

Description (last modified by sabernhardt)

When saving permalinks, if the server configuration file or the root directory is unwritable, the error message contains a read-only textarea without a label tag.

Attachments (3)

53142.diff (1.9 KB) - added by sabernhardt 7 months ago.
permalink-errors-before.png (84.4 KB) - added by sabernhardt 7 months ago.
current permalink messages without the label
permalink-errors-with-labels.png (87.6 KB) - added by sabernhardt 7 months ago.
adding a label to each error message's rewrite rules textarea (and adding rows to htaccess textarea)

Download all attachments as: .zip

Change History (12)

@sabernhardt
7 months ago

#1 @sabernhardt
7 months ago

  • Keywords has-patch added

53142.diff uses the same "Rewrite rules:" label text for the single textarea, whether it's for the web.config or .htaccess file.

I also added two rows to the .htaccess rules textarea.

This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.


7 months ago

#3 @sabernhardt
7 months ago

  • Description modified (diff)

#4 @joedolson
7 months ago

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

#5 @joedolson
7 months ago

  • Keywords needs-screenshots added
  • Milestone changed from Awaiting Review to 5.8

@sabernhardt
7 months ago

current permalink messages without the label

@sabernhardt
7 months ago

adding a label to each error message's rewrite rules textarea (and adding rows to htaccess textarea)

#6 @joedolson
7 months ago

  • Keywords has-screenshots commit added; needs-screenshots removed

#7 @sabernhardt
7 months ago

  • Description modified (diff)

Testing process

  1. Ideally, make the web.config file, root directory or .htaccess file unwritable. If that's not possible in your installation, adjust conditions within options-permalink.php to return true to force each error (see below).
  2. Navigate to Settings -> Permalinks.
  3. If you changed file/directory permissions, select a different permalink option and Save changes. (If conditions are forced, the error shows automatically.)
  4. Scroll down to find the error message.
  5. Check for a label with the read-only form element.

Ways to fake each situation

web.config is not writable

Replace the 3 consecutive conditional statements with true statements:

	if ( $iis7_permalinks ) :
		if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
			if ( file_exists( $home_path . 'web.config' ) ) :
root directory is not writable to edit/create web.config

Replace only the first 2 conditions with true statements (file_exists( $home_path . 'web.config' ) needs to remain false):

	if ( $iis7_permalinks ) :
		if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
.htaccess is not writable

Only replace this statement with a true condition:

	if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) :
Last edited 7 months ago by sabernhardt (previous) (diff)

#8 @joedolson
7 months ago

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

In 50830:

Permalinks: Add labels for permalink configuration fields.

If the current server configuration doesn't allow WordPress to edit permalink settings, the textarea with new rules to use was not labeled. Add labels and aria-describedby pointing to the field description.

Props sabernhardt
Fixes #53142.

This ticket was mentioned in Slack in #accessibility by sabernhardt. View the logs.


2 weeks ago

Note: See TracTickets for help on using tickets.