- if ( $this->params['prop'] ) {
- $propnames = $this->params['prop'];
- $properties = array();
- foreach ( $propnames as $propname ) {
- $values = $pageProps->getProperty( $pages, $propname );
- foreach ( $values as $page => $value ) {
- if ( !isset( $properties[$page] ) ) {
- $properties[$page] = array();
+
+ foreach ( $res as $row ) {
+ if ( $currentPage != $row->pp_page ) {
+ # Different page than previous row, so add the properties to
+ # the result and save the new page id
+
+ if ( $currentPage ) {
+ if ( !$this->addPageProps( $result, $currentPage, $props ) ) {
+ # addPageProps() indicated that the result did not fit
+ # so stop adding data. Reset props so that it doesn't
+ # get added again after loop exit
+
+ $props = array();
+ break;