bobbingwide / field-block-for-acf-pro

Field block for ACF PRO
https://www.oik-plugins.com/oik-plugins/field-block-for-acf-pro/
GNU General Public License v2.0
3 stars 0 forks source link

Cater for fields with no value #7

Open bobbingwide opened 1 year ago

bobbingwide commented 1 year ago

Some of the field types have render methods that access array elements within the field. They assume that a value has been entered. When it hasn't then a Fatal error may occur eg

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in C:\apache\htdocs\wordpress\wp-content\plugins\acf-field-block\includes\class-acf-field-block-renderer.php:385

The logic should take these instances into account and return early when there's nothing to render.

This test should be performed within the rendering method.