- Status changed to Needs review
over 1 year ago 12:44pm 1 August 2023 - last update
over 1 year ago 3 pass - last update
over 1 year ago 3 pass
I'm upgrading to php 8 and receive an error when I try to index the search. It is related to the each() function which is evidently deprecated in php 8 and appears several times in the file.
I understand that foreach() should replace it, but how should that be rewritten in the context of the function?
function apachesolr_multilingual_date_default_indexing_callback_implementation($entity, $field_name, $index_key, array $field_info) {
$fields = array();
if (!empty($entity->{$field_name})) {
$field = $entity->$field_name;
$values = array();
if (array_key_exists($entity->language, $field) && is_array($field[$entity->language])) {
$values = $field[$entity->language];
}
else {
list($lang, $values) = <strong>each($field);</strong>
if (!is_array($values)) {
$values = array();
}
}
Thanks,
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.