- Issue created by @xlin1003
- πͺπΈSpain Jose Reyero
Thanks, it works.
Not sure about php requirements though, it will be PHP7.4 for this code... (?)
The get_arguments_tokens()
function uses a while
loop to iterate over argument handlers:
while ($this->view->display_handler->get_handlers('argument')) { ... }
This results in an infinite loop because get_handlers()
returns a cached array of handlers that is never modified inside the loop.
The change was introduced as part of cleanup in issue #3386717, but was likely not intended.
---
1. Create a view with at least one contextual filter (argument).
2. Set "Link display" to "Custom URL"
3. Observe the request hanging or exhausting memory due to an infinite loop.
---
Replace the while
loop with a for
loop to properly iterate over the static list of argument handlers. For example:
$arguments = $this->view->display_handler->get_handlers('argument') ?? [];
$num_arguments = count($arguments);
for ($i = 0; $i < $num_arguments; $i++) {
...
}
Needs review
3.30
Code
Thanks, it works.
Not sure about php requirements though, it will be PHP7.4 for this code... (?)