Bug Report: ACF Google Map column causes TypeError in Admin Columns Pro 7.0.4
—
Bug Report: ACF Google Map column causes TypeError in Admin Columns Pro 7.0.4
Plugin version: Admin Columns Pro 7.0.4
ACF version: (add your version)
WordPress version: (add your version)
PHP version: (add your version)
Description
When using an ACF Google Map field as an admin column, a fatal error occurs when viewing the post list. The error
happens regardless of whether the field has a value or is empty.
Error message
Fatal error: Uncaught TypeError: AC\Formatter\EmptyValue::format(): Argument #1 ($value) must be of type
AC\Type\Value, string given, called in .../admin-columns-pro/admin-columns/classes/Formatter/TableRender.php on
line 51
Steps to reproduce
1. Create an ACF field group with a Google Map field
2. Assign it to a custom post type
3. In Admin Columns settings, add the Google Map field as a column
4. View the post list in wp-admin
Root cause
The format() method in addons/acf/classes/Value/Formatter/Maps.php (line 25) returns a string instead of a Value object:
return sprintf('%s', $url, $label);
Should be:
return $value->with_value(sprintf('%s', $url, $label));
Workaround
Remove the Google Map field from Admin Columns configuration until fixed.
You must be logged in to reply to this topic.