rchipka / advanced-custom-blocks

ACF integrations for Gutenberg blocks
75 stars 5 forks source link

PHP Notice: undefined index #14

Open jmml97 opened 6 years ago

jmml97 commented 6 years ago

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
ATomilov commented 6 years ago

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

jmml97 commented 6 years ago

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

ATomilov commented 6 years ago

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

jmml97 commented 6 years ago

image

There you have it

rchipka commented 6 years ago

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

Steviant-zz commented 5 years ago

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

rchipka commented 5 years ago

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

Steviant-zz commented 5 years ago

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
rchipka commented 5 years ago

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

fdm-group commented 5 years ago

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

rchipka commented 5 years ago

Try version 2.1.4 please

sidoneill commented 5 years ago

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 commented 5 years ago

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
klihelp commented 5 years ago

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

ghost commented 5 years ago

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`

rchipka commented 5 years ago

@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.

Loic57 commented 5 years ago

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