Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Noticed that field_group assumes that all formatter settings are either #options or strings. We have a setup where we add a nested configuration and the following block of code in field_group.module would end up passing an array (our nested settings) to drupal_strlen
if (isset($group_form['instance_settings'], $group_form['instance_settings'][$key]['#options'])) {
if (is_array($value)) {
$value = implode(array_filter($value), ', ');
}
else {
$value = $group_form['instance_settings'][$key]['#options'][$value];
}
}
// Shorten the string.
if (drupal_strlen($value) > 38) {
$value = truncate_utf8($value, 50, TRUE, TRUE);
}
which ended up giving notices like the following.
Warning: mb_strlen() expects parameter 1 to be string, array given in drupal_strlen() (line 482 of /includes/unicode.inc). Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1571 of /includes/bootstrap.inc).
I have modified code so that for now it will skip anything that is not either a plain string, or an array produced by #options
Comment | File | Size | Author |
---|---|---|---|
#2 | field_group-notice_during_formatter-2647958.patch | 1.67 KB | danquah |
Comments
Comment #2
danquah CreditAttribution: danquah at Reload commentedComment #3
sime7.x-2.x branch hasn't been updated in 8 years and doesn't have a recommended release. I'm closing all 7.x-2.x issues that are over 2 years old.
I'm going to mark this as fixed, to indicate there is a patch that can be used (thanks danquah), noting that is unlikely to be applied to the module.