WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
Attempting to fix the Strict errors in debug mode (3 posts)

  1. volfro
    Member
    Posted 7 months ago #

    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.)

    http://wordpress.org/plugins/front-end-editor/

  2. scribu
    Member
    Plugin Author

    Posted 7 months ago #

    Hey, I think it would be easier to open a pull request with the changes you already have and discuss any remaining issues there.

  3. volfro
    Member
    Posted 7 months ago #

    @scribu Sure thing. Didn't realize it was okay to submit a PR before changes were completed.

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic