Kipcool has submitted this change and it was merged. Change subject: OWDefinedExpressionListJob bug ......................................................................
OWDefinedExpressionListJob bug * undesired effect of selecting expressions without a language_id. ( expression from other language included just because they have an expression similar to the selected language.) fixed. : Change-Id: I43df81c9d9246d3d0460885fce6fba743ede7465 --- M OmegaWiki/WikiDataAPI.php M includes/formatCSV.php M includes/jobs/OWDefinedExpressionListJob.php 3 files changed, 4 insertions(+), 5 deletions(-) Approvals: Kipcool: Verified; Looks good to me, approved diff --git a/OmegaWiki/WikiDataAPI.php b/OmegaWiki/WikiDataAPI.php index bbbed68..a91296a 100644 --- a/OmegaWiki/WikiDataAPI.php +++ b/OmegaWiki/WikiDataAPI.php @@ -2158,7 +2158,8 @@ 'exp.expression_id = synt.expression_id', 'synt.remove_transaction_id' => null, 'exp.remove_transaction_id' => null - ), __METHOD__ + ), __METHOD__, + 'DISTINCT' ); $dmlist = array(); diff --git a/includes/formatCSV.php b/includes/formatCSV.php index 9a61ce4..c6eb8c3 100644 --- a/includes/formatCSV.php +++ b/includes/formatCSV.php @@ -20,6 +20,6 @@ if ( $column == '""') { return ''; } - return $column; + return preg_replace( '/\n/', '\\n', $column ); } } diff --git a/includes/jobs/OWDefinedExpressionListJob.php b/includes/jobs/OWDefinedExpressionListJob.php index 7d3d75e..2e140d0 100644 --- a/includes/jobs/OWDefinedExpressionListJob.php +++ b/includes/jobs/OWDefinedExpressionListJob.php @@ -128,9 +128,7 @@ } function getDefineList( $spelling, $languageId ) { - $dmlist = getExpressionMeaningIds( $spelling ); - // There are duplicates using getExpressionMeaningIds !!! - $dmlist = array_unique ( $dmlist ); + $dmlist = getExpressionMeaningIdsForLanguages( $spelling, array( $languageId ) ); $express = array(); foreach ( $dmlist as $definedMeaningId ) { $text = getDefinedMeaningDefinitionForLanguage( $definedMeaningId, $languageId ); -- To view, visit https://gerrit.wikimedia.org/r/83211 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43df81c9d9246d3d0460885fce6fba743ede7465 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLexicalData Gerrit-Branch: master Gerrit-Owner: Hiong3-eng5 <hiong3.e...@gmail.com> Gerrit-Reviewer: Kipcool <kipmas...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits