• Resolved Rhapsody348

    (@rhapsody348)


    Hello Javier,

    I am posting a minor item for clean up in a future release. I just noticed the following error log entry using version 1.21.2 and am suggesting a fix to prevent the log generation.

    This is the error log:

    [04-Nov-2022 11:47:11 UTC] PHP Warning: Undefined array key “default” in /home/***/***/blog/wp-content/plugins/import-users-from-csv-with-meta/classes/settings.php on line 209

    The suggested change to the settings.php file before line 209 which is return $settings[ $option ]['default']; is to insert the following:

            if( !isset( $settings[ $option ]['default'] ) )
                return false;
    
    
Viewing 1 replies (of 1 total)
  • Plugin Author Javier Carazo

    (@carazo)

    Thanks for your debugging.

    In the next release it will be fixed.

    But I have used this better because this !isset is managed before of it:

    if( !isset( $settings[ $option ]['default'] ) ){
                switch( $settings[ $option ] ){
                    case 'text':
                        return '';
        
                    case 'array_text':
                        return array();
        
                    case 'checkbox':
                        return false;
    
                    default:
                        return false;
                }
            }

    The default with return false should do the trick.

Viewing 1 replies (of 1 total)
  • The topic ‘Error Log Warning – Undefined array key “default”’ is closed to new replies.