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.
I give the warning when implement hook_redirect_load() from api.
<?php
function mymodule_redirect_load(array &$redirects, $types) {
}
Warning: Parameter 1 to mymodule_redirect_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 368 of includes\entity.inc).
Comment | File | Size | Author |
---|---|---|---|
#6 | redirect_load_alter-2763681-2.patch | 862 bytes | belyj_vladislav |
Comments
Comment #2
belyj_vladislav CreditAttribution: belyj_vladislav commentedComment #3
belyj_vladislav CreditAttribution: belyj_vladislav commentedUse the hook_redirect_load_alter() instead hook_redirect_load()
Comment #4
belyj_vladislav CreditAttribution: belyj_vladislav commentedComment #5
Dave ReidI think the docs should not have the reference around &$redirects, because it's an array of objects, and objects are passed by reference (technically by pointer). So there's no need to modify the array by reference.
Comment #6
belyj_vladislav CreditAttribution: belyj_vladislav commentedOh, you are right, thanks
Comment #7
belyj_vladislav CreditAttribution: belyj_vladislav commentedComment #8
belyj_vladislav CreditAttribution: belyj_vladislav commentedComment #9
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch in #6 is 2 years old, but still applies cleanly to the latest 7.x-1.x-dev and fixes this issue for me so changing the issue status accordingly.
Comment #10
Chris Matthews CreditAttribution: Chris Matthews commentedComment #11
alex_optimLooks good.
Comment #12
volegerLooks good
Comment #13
pifagorComment #16
pifagor