From: Roan Kattouw Date: Thu, 7 Feb 2008 12:21:48 +0000 (+0000) Subject: (bug 12953) prop=imageinfo should only set query-continue when there is only one... X-Git-Tag: 1.31.0-rc.0~49569 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=a95cd777c77b3e0c7f18a6f10c95dbfa5dc3de57;p=lhc%2Fweb%2Fwiklou.git (bug 12953) prop=imageinfo should only set query-continue when there is only one title; trying to overwrite a previously set query-continue causes a fatal error --- diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 0e214db3f8..fb11c12d35 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -81,11 +81,13 @@ class ApiQueryImageInfo extends ApiQueryBase { // Now get the old revisions // Get one more to facilitate query-continue functionality $count = count($data); - $oldies = $img->getHistory($params['limit'] - count($data) + 1, $params['start'], $params['end']); + $oldies = $img->getHistory($params['limit'] - $count + 1, $params['start'], $params['end']); foreach($oldies as $oldie) { if(++$count > $params['limit']) { // We've reached the extra one which shows that there are additional pages to be had. Stop here... - $this->setContinueEnumParameter('start', $oldie->getTimestamp()); + // Only set a query-continue if there was only one title + if(count($pageIds[NS_IMAGE]) == 1) + $this->setContinueEnumParameter('start', $oldie->getTimestamp()); break; } $data[] = $this->getInfo($oldie);