When we use pager there still exists a call to the parent getNextUrls()
method which tries to get the next page URL from the response header:
public function getNextUrls(string $url): array {
$next_urls = [];
$headers = $this->getResponse($url)->getHeader('Link');
if (!empty($headers)) {
$headers = explode(',', $headers[0]);
foreach ($headers as $header) {
$matches = [];
preg_match('/^<(.*)>; rel="next"$/', trim($header), $matches);
if (!empty($matches) && !empty($matches[1])) {
$next_urls[] = $matches[1];
}
}
}
return array_merge(parent::getNextUrls($url), $next_urls);
}
It adds an additional request that looks unneeded when the pager is used.
As I understand it's made for BC reasons. The code was used before the pager was added.
When some pager is selected prevent the parent method call because in that case, it is unneeded. Use it only if the pager is not selected.
Needs review
6.0
Plugins