#2 solved it for me,
thanks!
Patch #11 works for me too on php 8.1.
Changed to RTBC.
The rendering of the active items is back and ok now :).
In php8.1 I still have a log warning:
Warning: CurrentSearchItemActiveLinks::{closure}(): Argument #1 ($item) must be passed by reference, value given in CurrentSearchItemActiveLinks->execute() (regel 126 van ../modules/patched/current_search_links/plugins/item_active_links.inc).
This is my/your code with line 126 marked
return [
'#theme' => 'item_list',
'#items' => array_map(function (&$item) {
return drupal_render($item);
}, $items), //line 126
'#attributes' => ['class' => $classes],
];
}
}
And the screenshots
I used the patch from MR.
I noticed that the active items are gone, not rendered after the patch.
To render the active items I changed some lines:
return [
'#theme' => 'item_list',
'#items' => array_map(function (&$item) {
return $item;
}, $items),
'#attributes' => ['class' => $classes],
];
}
}
to
return [
'#theme' => 'item_list',
'#items' => array_map('drupal_render', array_map(function (&$item) {
return $item;
}, $items)), //line136
'#attributes' => ['class' => $classes],
];
}
}
The active links are rendered now, see screenshots.
This part of the code '#items' => array_map('drupal_render', array_map(function (&$item) { is in the origin code in my module, I don't know why, I think the original builders changed it to render the active links.
In the logs I have now:
Warning: drupal_render(): Argument #1 ($elements) must be passed by reference, value given in CurrentSearchItemActiveLinks->execute() (regel 136 van ../modules/patched/current_search_links/plugins/item_active_links.inc).
I marked line 136 above.
Sorry, I am a websitebuilder not a php coder. Hope you can help here.
Hi abhishek_virasat, thanks for bug fixing this php8 issue.
After patching with #5 and a CC: on a search page I have two PHP warnings in the logs:
Warning: drupal_render(): Argument #1 ($elements) must be passed by reference, value given in CurrentSearchItemActiveLinks->execute() (regel 127 van ../modules/patched/current_search_links/plugins/item_active_links.inc).
Warning: CurrentSearchItemActiveLinks::{closure}(): Argument #1 ($item) must be passed by reference, value given in CurrentSearchItemActiveLinks->execute() (regel 127 van ../modules/patched/current_search_links/plugins/item_active_links.inc).
Could someone create a patch for Drupal 7.98.
I am not a coder but would like to patch my site with the correct patch.
Thanks.
Patch #35 does not apply to the latest drupal-7.98.
I have a Dutch language site.
The patch did work for custum roles.
Not for anonymous (anonieme gebruiker) and authenticated (geverifieerde gebruiker).