I found some occurrences of code affected by the uniform variable syntax changes for PHP 7:

Searching files for ->\$\w*?\[ (regex)

linkchecker.module (line 1551)

$field = field_info_field($field_name);
// #1923328: field_name array may be missing in $entity.
$entity_field = isset($entity->$field['field_name']) ? $entity->$field['field_name'] : array();

linkchecker.module (line 1618)

foreach (field_info_instances($entity_type, $bundle_name) as $field_name => $instance) {
$field = field_info_field($field_name);
$entity_field =& $entity->$field['field_name'];

Each section uses $entity->$field['field_name'], which in PHP 5 means $entity->{$field['field_name']}, but in PHP 7 means ($entity->$field)['field_name']. So if the module supports both, the code should probably be made explicit so that it is consistent across versions. I don't know which interpretation is correct.

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

Issue summary: View changes
c-logemann’s picture

Only for the priority: Is this currently an error or a warning on PHP 7 and on which subversions of PHP 7.

solideogloria’s picture

I don't know if there are errors. The syntax changed between versions and I found this ambiguity via a code scan.

euk’s picture

UPD: This seems to be fixed in 7.x-1.4, while I was referring to 7x.1.2

I was observing these:
Notice: Array to string conversion in _linkchecker_parse_fields() (line 1551 of /var/www/html/dev/doi_dev.opengov.ibmcloud.com/current/modules/contrib/linkchecker/linkchecker.module).

It also seems to have a side effect of returning NULL on line 1195 - not always, but occasionally, I see a warning that argument #2 of array_merge is not an array:

$text_items_by_field = array_merge($text_items_by_field, _linkchecker_parse_fields('node', $node->type, $node, TRUE));
solideogloria’s picture

@euk, I don't think that's related to this issue.

quadrexdev’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.