Fatal error in acf_vc_helper.php
-
I started getting the following error recently, possibly after updating PHP from version 7 to 8:
Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/acf-vc-integrator/inc/acf_vc_helper.php:670
Version details:
- WordPress 6.7.1
- PHP 8.2.27
- ACF-VC Integrator 1.8.6
- ACF PRO 6.3.12
- WPBakery 8.1
I fixed it by replacing the function “link” in acf_vc_helper.php (lines 665-686) with the following:
public function link($field, $args, $post_id) {
$link = $field["value"];
if ($field["return_format"] == "array" && is_array($link)) {
$link_titel = !empty($link["title"]) ? $link["title"] : ($link["url"] ?? '');
$link_target = !empty($link['target']) ? $link['target'] : "_self";
$output = '<a href="' . esc_url($link["url"] ?? '') . '" target="' . esc_attr($link_target) . '">' . esc_html($link_titel) . '</a>';
} else {
$output = '<a href="' . esc_url((string) $link) . '">' . esc_html((string) $link) . '</a>';
}
return apply_filters('acfvc_link', $output, $field, $post_id);
}Please verify and implement the fix.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.