Kipcool has submitted this change and it was merged. Change subject: Routine simplification ......................................................................
Routine simplification Change-Id: I1252ef8261ac20d69dfd4e4b380ff2d3c79a63ce --- M OmegaWiki/SpecialSuggest.php M OmegaWiki/WikiDataAPI.php 2 files changed, 5 insertions(+), 19 deletions(-) Approvals: Kipcool: Verified; Looks good to me, approved diff --git a/OmegaWiki/SpecialSuggest.php b/OmegaWiki/SpecialSuggest.php index 39402f4..b92a1d3 100644 --- a/OmegaWiki/SpecialSuggest.php +++ b/OmegaWiki/SpecialSuggest.php @@ -283,21 +283,10 @@ $classMids = $wgDefaultClassMids ; if ( ( !is_null($syntransId) ) && ( !is_null($wgIso639_3CollectionId)) ) { - // find the language of the syntrans and add attributes of that language by adding the language DM to the list of default classes + // find the language of the syntrans and add attributes of that language + // by adding the language DM to the list of default classes // this first query returns the language_id - $expressionId = $this->dbr->selectField( - $this->dc . '_syntrans', - 'expression_id', - array( 'syntrans_sid' => $syntransId ), - __METHOD__ - ); - - $language_id = $this->dbr->selectField( - $this->dc . '_expression', - 'language_id', - array( 'expression_id' => $expressionId ), - __METHOD__ - ); + $language_id = OwDatabaseAPI::getLanguageId( array( 'sid' => $syntransId ) ); // this second query finds the DM number for a given language_id $language_dm_id = $this->dbr->selectField( diff --git a/OmegaWiki/WikiDataAPI.php b/OmegaWiki/WikiDataAPI.php index 30c6443..638ea99 100644 --- a/OmegaWiki/WikiDataAPI.php +++ b/OmegaWiki/WikiDataAPI.php @@ -2530,9 +2530,7 @@ // we can get rid of using the syntrans table $cond = array( 'spelling' => $spelling, - 'exp.expression_id = synt.expression_id', - 'exp.remove_transaction_id' => null, - 'synt.remove_transaction_id' => null + 'exp.remove_transaction_id' => null ); if ( ! empty( $langsubset ) ) { $cond['language_id'] = $langsubset; @@ -2540,8 +2538,7 @@ $queryResult = $dbr->select( array( - 'exp' => "{$dc}_expression", - 'synt' => "{$dc}_syntrans" + 'exp' => "{$dc}_expression" ), array( 'exp.expression_id', 'spelling', 'language_id' ), $cond, -- To view, visit https://gerrit.wikimedia.org/r/139571 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1252ef8261ac20d69dfd4e4b380ff2d3c79a63ce Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikiLexicalData Gerrit-Branch: master Gerrit-Owner: Hiong3-eng5 <hiong3.e...@gmail.com> Gerrit-Reviewer: Kipcool <kipmas...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits