Attempting to fix the Strict errors in debug mode
-
I detailed the issue I’m having on StackExchange, but figured I should post here as well:
I’m almost ready to submit a pull request that fixes those Strict notices in 3.8, but I’ve run into a roadblock.
/php/fields/widget.php is giving me guff:
Notice: Undefined index: after_widget in \wp-content\front-end-editor\php\fields\widget.php on line 25
The offending method:
function wrap( $content, $data = null, $params = null ) { if ( !$this->check() ) return $params; $p =& $params[0]; // Text widgets are handled differently if ( 0 === strpos( $p['widget_id'], 'text-' ) ) return $params; $wrap = parent::wrap( '', '', array( 'widget_id' => $p['widget_id'], 'sidebar_id' => $p['id'] ) ); list( $before, $after ) = scbUtil::split_at( '</', $wrap ); $p['before_widget'] = $p['before_widget'] . $before; $p['after_widget'] = $after . $p['after_widget']; return $params; }
The thing that confuses me about this is that doing a
var_dump
on$p
shows that the'after_widget'
index is defined. Also, commenting out either of the$p[]
declarations results in the error disappearing.Hopefully we can get this resolved and submit the pull request. (Feel free to download and test my changes from Github, too; I haven’t done too much testing yet, and I’m not super great at PHP.)
- The topic ‘Attempting to fix the Strict errors in debug mode’ is closed to new replies.