[MediaWiki-commits] [Gerrit] Blog: Changed query assembly - change (mediawiki...BlueSpiceExtensions)
jenkins-bot has submitted this change and it was merged. Change subject: Blog: Changed query assembly .. Blog: Changed query assembly Changed the order of the query assembly because otherwise a the JOIN condition for 'page_props' table would be applied to 'categorylinks' table. A SQL error would be the result. Change-Id: Idf9c93ce92b2bab100f6feb4defcd81c4716e900 --- M Blog/Blog.class.php 1 file changed, 11 insertions(+), 11 deletions(-) Approvals: Mglaser: Looks good to me, approved jenkins-bot: Verified diff --git a/Blog/Blog.class.php b/Blog/Blog.class.php index d9a0d14..1b46ec4 100644 --- a/Blog/Blog.class.php +++ b/Blog/Blog.class.php @@ -537,6 +537,17 @@ $dbr = wfGetDB( DB_SLAVE ); + if ( $argsSCategory ) { + $aTables[] = 'categorylinks'; + $aConditions['cl_to'] = $argsSCategory; + $aConditions[] = 'cl_from = page_id'; + } else { + if ( $argsModeNamespace === 'ns' ) { + $aConditions['page_id'] = $aArticleIds; + } + $aConditions['page_namespace'] = $argsINamespace; + } + // get blog entries if( $argsSSortBy == 'title' ) { $aOptions['ORDER BY'] = 'page_title ASC'; @@ -569,17 +580,6 @@ $aTables[] = 'page_props'; $aConditions[] = 'rev_page = page_id'; $aJoins['page_props'] = array( 'LEFT JOIN', "pp_page = rev_page AND pp_propname = 'blogtime'" ); - } - - if ( $argsSCategory ) { - $aTables[] = 'categorylinks'; - $aConditions['cl_to'] = $argsSCategory; - $aConditions[] = 'cl_from = page_id'; - } else { - if ( $argsModeNamespace === 'ns' ) { - $aConditions['page_id'] = $aArticleIds; - } - $aConditions['page_namespace'] = $argsINamespace; } $res = $dbr->select( -- To view, visit https://gerrit.wikimedia.org/r/255394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf9c93ce92b2bab100f6feb4defcd81c4716e900 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Robert Vogel Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Blog: Changed query assembly - change (mediawiki...BlueSpiceExtensions)
Robert Vogel has uploaded a new change for review. https://gerrit.wikimedia.org/r/255394 Change subject: Blog: Changed query assembly .. Blog: Changed query assembly Changed the order of the query assembly because otherwise a the JOIN condition for 'page_props' table would be applied to 'categorylinks' table. A SQL error would be the result. Change-Id: Idf9c93ce92b2bab100f6feb4defcd81c4716e900 --- M Blog/Blog.class.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/94/255394/1 diff --git a/Blog/Blog.class.php b/Blog/Blog.class.php index d9a0d14..1b46ec4 100644 --- a/Blog/Blog.class.php +++ b/Blog/Blog.class.php @@ -537,6 +537,17 @@ $dbr = wfGetDB( DB_SLAVE ); + if ( $argsSCategory ) { + $aTables[] = 'categorylinks'; + $aConditions['cl_to'] = $argsSCategory; + $aConditions[] = 'cl_from = page_id'; + } else { + if ( $argsModeNamespace === 'ns' ) { + $aConditions['page_id'] = $aArticleIds; + } + $aConditions['page_namespace'] = $argsINamespace; + } + // get blog entries if( $argsSSortBy == 'title' ) { $aOptions['ORDER BY'] = 'page_title ASC'; @@ -569,17 +580,6 @@ $aTables[] = 'page_props'; $aConditions[] = 'rev_page = page_id'; $aJoins['page_props'] = array( 'LEFT JOIN', "pp_page = rev_page AND pp_propname = 'blogtime'" ); - } - - if ( $argsSCategory ) { - $aTables[] = 'categorylinks'; - $aConditions['cl_to'] = $argsSCategory; - $aConditions[] = 'cl_from = page_id'; - } else { - if ( $argsModeNamespace === 'ns' ) { - $aConditions['page_id'] = $aArticleIds; - } - $aConditions['page_namespace'] = $argsINamespace; } $res = $dbr->select( -- To view, visit https://gerrit.wikimedia.org/r/255394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf9c93ce92b2bab100f6feb4defcd81c4716e900 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits