Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1407459

    I am getting multiple PHP warnings in my error logs:

    PHP Warning: Undefined array key "key" in /home/gyghgfduser/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/class-svg-shapes.php on line 515

    I have this in my functions.php which may or may not be related:

    function custom_avf_custom_svg_shapes( array $custom_shapes ) {
    // example for uploading a svg file:  your_file.svg 
    $custom_shapes = array (
    	'grad-triangle'	=> array(
    		'title'			=> __('Gradient triangle', 'avia_framework' ), // Name displayed in select box - whatever you like 
    		'has_negative'	=> false,				// uploaded file had to be named: your_file-negative.svg
    		'has_flip'		=> true,
    		'has_width'		=> true,
    		//'path'			=> string,				// if you like to determine a different path (absolute)
    		'filename'		=> 'grad-triangle'			// .svg will be added if missing
    		//'attachment'			=> integer,				// attachment id of uploaded media ( if you like to determine )
    		//'attachment_negative'	=> integer 				// attachment id of negative uploaded media ( if you like to determine )
    	),
    	'hp-banner-divider'	=> array(
    		'title'			=> __('Homepage divider', 'avia_framework' ), // Name displayed in select box - whatever you like 
    		'has_negative'	=> false,				// uploaded file had to be named: your_file-negative.svg
    		'has_flip'		=> false,
    		'has_width'		=> false,
    		//'path'			=> string,				// if you like to determine a different path (absolute)
    		'filename'		=> 'hp-banner-divider'			// .svg will be added if missing
    		//'attachment'			=> integer,				// attachment id of uploaded media ( if you like to determine )
    		//'attachment_negative'	=> integer 				// attachment id of negative uploaded media ( if you like to determine )
    	),
    	'hp-banner-divider-no-wedge'	=> array(
    		'title'			=> __('Homepage divider (no wedge)', 'avia_framework' ), // Name displayed in select box - whatever you like 
    		'has_negative'	=> false,				// uploaded file had to be named: your_file-negative.svg
    		'has_flip'		=> false,
    		'has_width'		=> false,
    		//'path'			=> string,				// if you like to determine a different path (absolute)
    		'filename'		=> 'hp-banner-divider-no-wedge'			// .svg will be added if missing
    		//'attachment'			=> integer,				// attachment id of uploaded media ( if you like to determine )
    		//'attachment_negative'	=> integer 				// attachment id of negative uploaded media ( if you like to determine )
    	),
    );
    return $custom_shapes;
    }
    add_filter( 'avf_custom_svg_shapes', 'custom_avf_custom_svg_shapes', 10, 1 );

    Are the PHP Warnings likely to be because of something I have done or a missing key check in Enfold?

    Thanks

    #1407474

    Hey Rustybucket,

    Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #1407534

    Details in private

    #1407542

    Hi,

    You have to add ‘key’ to your array, e.g.

    
    'hp-banner-divider-no-wedge'	=> array(
           'key'   => 'hp-banner-divider-no-wedge',
           ......
    

    Sorry, I missed to add this to the the comment. Will fix this for next release.
    Compare config-templatebuilder\avia-template-builder\php\class-svg-shapes.php function init_native_shapes()

    Best regards,
    Günter

    #1407546

    Thanks Günter, much appreciated.

    #1407630

    Hi,

    Great, I’m glad that Günter could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.