diff --git a/core/modules/comment/src/CommentStatistics.php b/core/modules/comment/src/CommentStatistics.php index 0c3fe61..588c831 100644 --- a/core/modules/comment/src/CommentStatistics.php +++ b/core/modules/comment/src/CommentStatistics.php @@ -167,7 +167,7 @@ public function getRankingInfo() { ), // Inverse law that maps the highest view count on the site to 1 and 0 // to 0. Note that the ROUND here is necessary for PostgreSQL and SQLite - // in order to ensure that the :statistics_scale argument is treated as + // in order to ensure that the :comment_scale argument is treated as // a numeric type, because the PostgreSQL PDO driver sometimes puts // values in as strings instead of numbers in complex expressions like // this. diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php index 5e44832..c1ecb48 100644 --- a/core/modules/search/src/SearchQuery.php +++ b/core/modules/search/src/SearchQuery.php @@ -508,7 +508,11 @@ public function addScore($score, $arguments = array(), $multiply = FALSE) { if ($multiply) { $i = count($this->multiply); // Modify the score expression so it is multiplied by the multiplier, - // with a divisor to renormalize. + // with a divisor to renormalize. Note that the ROUND here is necessary + // for PostgreSQL and SQLite in order to ensure that the :multiply_* and + // :total_* arguments are treated as a numeric type, because the + // PostgreSQL PDO driver sometimes puts values in as strings instead of + // numbers in complex expressions like this. $score = "(ROUND(:multiply_$i, 4)) * COALESCE(($score), 0) / (ROUND(:total_$i, 4))"; // Add an argument for the multiplier. The :total_$i argument is taken // care of in the execute() method, which is when the total divisor is