advanced-custom-blocks icon indicating copy to clipboard operation
advanced-custom-blocks copied to clipboard

PHP Notice: undefined index

Open jmml97 opened this issue 6 years ago • 17 comments

After I activate the plugin I get all these errors and I can't get he plugin to work:

Notice: Undefined index: post in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 190

Notice: Undefined index: block_name in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 195

Notice: Undefined index: block_name in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 195

Notice: Undefined index: post_id in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 39

Notice: Undefined index: post in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 40

Notice: Undefined index: post_id in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 40

Notice: Undefined index: attributes in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 40

Notice: Undefined index: block_name in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 195

Notice: Undefined index: post in \wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 207

jmml97 avatar Sep 03 '18 11:09 jmml97

@jmml97 you are used the last plugin's version?

ATomilov avatar Sep 03 '18 11:09 ATomilov

Yes, I'm using the latest version, just downloaded it from GitHub like an hour ago.

jmml97 avatar Sep 03 '18 11:09 jmml97

@jmml97 can you send a first notice's bit of code screenshot ? Because in my code editor have no post index on line 190.

ATomilov avatar Sep 03 '18 11:09 ATomilov

image

There you have it

jmml97 avatar Sep 03 '18 12:09 jmml97

@jmml97 Yes, we need to change some stuff to make PHP happy. Should be an easy fix.

rchipka avatar Sep 04 '18 13:09 rchipka

Is there any progress on this? I'm getting the same errors.

Steviant-zz avatar Oct 01 '18 10:10 Steviant-zz

Try the latest version. This version uses a function to access some of the array properties.

rchipka avatar Oct 04 '18 17:10 rchipka

Still getting this, I'm afraid:

Notice: Undefined index: post in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 247

Notice: Undefined index: post_id in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 62

Notice: Undefined index: post in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 63

Notice: Undefined index: post_id in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 63

Notice: Undefined index: attributes in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 63

Notice: Undefined index: block_name in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 253

Notice: Undefined index: block_name in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 253

Notice: Undefined index: post in /var/www/public/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 266

Steviant-zz avatar Oct 04 '18 17:10 Steviant-zz

@Steviant can you double check your installed version? I don't think the referenced variables even exist at those indexes in the latest version.

rchipka avatar Oct 05 '18 16:10 rchipka

I have similar issue with latest version of the plugin:

Notice: Undefined index: post in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 326

Notice: Undefined index: block_name in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 332

Notice: Undefined index: block_name in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 332

Notice: Undefined index: block_name in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 332

Notice: Undefined index: block_name in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 332

Notice: Undefined index: block_name in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 332

Notice: Undefined index: post_id in C:\MAMP\htdocs\fresh\wp-content\plugins\advanced-custom-blocks-master\advanced-custom-blocks.php on line 62

fdm-group avatar Oct 08 '18 10:10 fdm-group

Try version 2.1.4 please

rchipka avatar Oct 09 '18 16:10 rchipka

I get this issue with version 2.1.4 on MAMP (but works fine with 2.0.2). I get the issue with both of these versions on my flywheel production server, same site (a multisite).

Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 190 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 39 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post_id in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: attributes in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 40 Notice: Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 207

sidoneill avatar Oct 10 '18 14:10 sidoneill

Also seeing:

[10-Oct-2018 13:58:04 UTC] PHP Notice:  Undefined index: post in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 190
[10-Oct-2018 13:58:04 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function acf_get_field_groups() in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php:194
Stack trace:
#0 /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php(116): acf_gb_get_block_field_groups()
#1 /www/wp-includes/class-wp-hook.php(286): {closure}('')
#2 /www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#3 /www/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#4 /www/wp-settings.php(453): do_action('init')
#5 /www/wp-config.php(92): require_once('/www/wp-setting...')
#6 /www/wp-load.php(37): require_once('/www/wp-config....')
#7 /www/wp-admin/admin.php(31): require_once('/www/wp-load.ph...')
#8 /www/wp-admin/index.php(10): require_once('/www/wp-admin/a...')
#9 {main}
  thrown in /www/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 194

sidoneill avatar Oct 10 '18 14:10 sidoneill

Same, php error/notice ( ! ) Notice: Undefined index: block_name in /var/www/html/wp-content/plugins/acf-custom-blocks/advanced-custom-blocks.php on line 319

klihelp avatar Oct 23 '18 14:10 klihelp

Getting similar error

` Notice: Undefined index: block_name in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 319

Notice: Undefined index: block_name in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 319

Notice: Undefined index: post in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 339

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Notice: Undefined index: block_meta in /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/phyn2/wp-content/plugins/advanced-custom-blocks-master/advanced-custom-blocks.php:31) in /Applications/MAMP/htdocs/phyn2/wp-includes/pluggable.php on line 1219`

ghost avatar Oct 23 '18 18:10 ghost

@GregPhyn I'd gladly accept a PR from anyone getting these errors.

All that needs to be done is to put an isset() condition around each one of these lines.

rchipka avatar Oct 23 '18 18:10 rchipka

same for me, I'm a noob dev, I have no idea what to do.

In fact I don't even see my new block on the admin, I can create It in ACF but not seeing it in gutenberg

Loic57 avatar Dec 19 '18 10:12 Loic57