Title: Undefined array key &#8220;type&#8221;
Last modified: December 1, 2023

---

# Undefined array key “type”

 *  Resolved [emgerold](https://wordpress.org/support/users/emgerold/)
 * (@emgerold)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-type-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * (@hardeepasrani)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/#post-17248463)
 * Hey [@emgerold](https://wordpress.org/support/users/emgerold/),
 * Can you edit the page that is causing this issue and send us the content of the
   page?
 *  Thread Starter [emgerold](https://wordpress.org/support/users/emgerold/)
 * (@emgerold)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/#post-17250105)
 *     ```wp-block-code
       {
         "__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](https://wordpress.org/support/users/emgerold/)
 * (@emgerold)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/#post-17250275)
 * I solved the problem by changing the code in **otter-blocks/inc/class-registration.
   php** on line 1008 to the following:
 *     ```wp-block-code
       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;
       	}
       }
       ```
   
 *  [gce7](https://wordpress.org/support/users/gce7/)
 * (@gce7)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/#post-17250436)
 * Wow! Thank you so much! Working Now Nice! Cool
 * Thank you so much [@emgerold](https://wordpress.org/support/users/emgerold/)
 * God bless you!!!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Undefined array key “type”’ is closed to new replies.

 * ![](https://ps.w.org/otter-blocks/assets/icon-256x256.gif?rev=3452114)
 * [Otter Blocks - Gutenberg Blocks, Page Builder for Gutenberg Editor & FSE](https://wordpress.org/plugins/otter-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/otter-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/otter-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/otter-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/otter-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/otter-blocks/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [gce7](https://wordpress.org/support/users/gce7/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-type-3/#post-17250436)
 * Status: resolved