• Resolved emgerold

    (@emgerold)


    Hello there,

    since I updated to the latest otter blocks version 2.5.1 I receive an error over all pages. The error is:

    Warning: Undefined array key “type” in /home/httpd/vhosts/…wp-content/plugins/otter-blocks/inc/class-registration.php on line 1008

    Is someone else having this issue? Any ideas how to fix this?

    Thanks in advance ??

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @emgerold,

    Can you edit the page that is causing this issue and send us the content of the page?

    Thread Starter emgerold

    (@emgerold)

    {
      "__file": "wp_export",
      "version": 2,
      "content": "<!-- wp:themeisle-blocks/form {\"id\":\"wp-block-themeisle-blocks-form-98bc29ce\",\"optionName\":\"f6b679da1fee8955f18043ae91edd8de83ea55b1_98bc29ce\"} -->\n<div id=\"wp-block-themeisle-blocks-form-98bc29ce\" class=\"wp-block-themeisle-blocks-form\" data-option-name=\"f6b679da1fee8955f18043ae91edd8de83ea55b1_98bc29ce\"><form class=\"otter-form__container\"><!-- wp:themeisle-blocks/form-input {\"id\":\"wp-block-themeisle-blocks-form-input-ca5ea4f3\",\"label\":\"Name\",\"isRequired\":true} -->\n<div id=\"wp-block-themeisle-blocks-form-input-ca5ea4f3\" class=\"wp-block-themeisle-blocks-form-input\"><label for=\"wp-block-themeisle-blocks-form-input-ca5ea4f3-input\" class=\"otter-form-input-label\"><span class=\"otter-form-input-label__label\">Name</span><span class=\"required\">*</span></label><input type=\"text\" id=\"wp-block-themeisle-blocks-form-input-ca5ea4f3-input\" required class=\"otter-form-input\"/></div>\n<!-- /wp:themeisle-blocks/form-input -->\n\n<!-- wp:themeisle-blocks/form-input {\"id\":\"wp-block-themeisle-blocks-form-input-67752e04\",\"type\":\"email\",\"label\":\"Email\",\"isRequired\":true} -->\n<div id=\"wp-block-themeisle-blocks-form-input-67752e04\" class=\"wp-block-themeisle-blocks-form-input\"><label for=\"wp-block-themeisle-blocks-form-input-67752e04-input\" class=\"otter-form-input-label\"><span class=\"otter-form-input-label__label\">Email</span><span class=\"required\">*</span></label><input type=\"email\" id=\"wp-block-themeisle-blocks-form-input-67752e04-input\" required class=\"otter-form-input\"/></div>\n<!-- /wp:themeisle-blocks/form-input -->\n\n<!-- wp:themeisle-blocks/form-nonce {\"formId\":\"wp-block-themeisle-blocks-form-98bc29ce\"} /-->\n\n<!-- wp:themeisle-blocks/form-textarea {\"id\":\"wp-block-themeisle-blocks-form-textarea-91c16e54\",\"label\":\"Message\"} -->\n<div id=\"wp-block-themeisle-blocks-form-textarea-91c16e54\" class=\"wp-block-themeisle-blocks-form-textarea\"><label for=\"wp-block-themeisle-blocks-form-textarea-91c16e54-input\" class=\"otter-form-textarea-label\"><span class=\"otter-form-textarea-label__label\">Message</span></label><textarea id=\"wp-block-themeisle-blocks-form-textarea-91c16e54-input\" rows=\"10\" class=\"otter-form-textarea-input\"></textarea></div>\n<!-- /wp:themeisle-blocks/form-textarea -->\n\n<!-- wp:paragraph {\"fontSize\":\"extra-small\"} -->\n<p class=\"has-extra-small-font-size\">You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.</p>\n<!-- /wp:paragraph --><div class=\"wp-block-button\"><button class=\"wp-block-button__link\" type=\"submit\">Submit</button></div></form></div>\n<!-- /wp:themeisle-blocks/form -->"
    }

    This is the content as JSON.

    Thread Starter emgerold

    (@emgerold)

    I solved the problem by changing the code in otter-blocks/inc/class-registration.php on line 1008 to the following:

    foreach ( $block['attrs']['otterConditions'] as $group ) {
    	foreach ( $group as $condition ) {
    		if (array_key_exists('type', $condition)) {
    			if ('screenSize' === $condition['type'] && isset( $condition['screen_sizes'] ) && is_array( $condition['screen_sizes'] ) ) {
    				$has_condition = true;
    				break;
    			}
    		}
    		
    			
    	}
    
    	if ( $has_condition ) {
    		break;
    	}
    }

    Wow! Thank you so much! Working Now Nice! Cool

    Thank you so much @emgerold

    God bless you!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Undefined array key “type”’ is closed to new replies.