Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#37380 closed defect (bug) (fixed)

Undefined variable: usingpi / Undefined variable: writable / Undefined variable: update_required

Reported by: andreasneuber's profile andreasneuber Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.6
Component: Permalinks Keywords: has-patch
Focuses: Cc:

Description

Happens with 4.6-beta3-38065

Steps
1.Fresh WP
2.Login
3.Go to Settings > Permalinks
4.Press "Save Changes"
5.Check debug.log

debug.log has these entries

PHP Notice:  Undefined variable: usingpi in /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php on line 113
PHP Stack trace:
PHP   1. {main}() /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php:0
PHP Notice:  Undefined variable: writable in /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php on line 113
PHP Stack trace:
PHP   1. {main}() /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php:0
PHP Notice:  Undefined variable: update_required in /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php on line 113
PHP Stack trace:
PHP   1. {main}() /var/www/html/tmp_phpnotices_60/wp-admin/options-permalink.php:0

My environment
-Apache/2.4.7 (Ubuntu)
-PHP version: 7.0.8-4 / Apache 2.0 Handler

Attachments (2)

37380.patch (633 bytes) - added by Clorith 7 years ago.
37380.2.patch (2.3 KB) - added by Clorith 7 years ago.
Moves a larger block up as $write and $update_required also need to be available sooner

Download all attachments as: .zip

Change History (5)

@Clorith
7 years ago

#1 @Clorith
7 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.6

Hi there, and thanks for the report!

This is indeed introduced in 4.6-beta3, with revision r37747

The attached patch moves the definition of $usingpi to be available before the IF block.

@Clorith
7 years ago

Moves a larger block up as $write and $update_required also need to be available sooner

#2 @SergeyBiryukov
7 years ago

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

In 38066:

Permalinks: After [37747], make sure $usingpi, $writable, and $update_required are defined before checking them on permalinks update.

Props Clorith.
Fixes #37380.

#3 @SergeyBiryukov
7 years ago

In 38067:

Permalinks: Rename $usingpi to $using_index_permalinks for clarity.

See #37380.

Note: See TracTickets for help on using tickets.