forked from wikimedia/mediawiki
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See Universal-Omega/DynamicPageList3#170 [4.1.x] ERM28444
- Loading branch information
1 parent
dd6fcfc
commit fac8358
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
_bluespice/patches/extensions/DynamicPageList3/includes/Parse.php.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/includes/Parse.php b/includes/Parse.php | ||
index b6775a3..58b579f 100644 | ||
--- a/includes/Parse.php | ||
+++ b/includes/Parse.php | ||
@@ -202,7 +202,13 @@ class Parse { | ||
$query = new Query( $this->parameters ); | ||
|
||
$foundRows = null; | ||
- $rows = $query->buildAndSelect( $calcRows, $foundRows ); | ||
+ $profilingContext = ''; | ||
+ $currentTitle= $parser->getTitle(); | ||
+ if ( $currentTitle instanceof Title ) { | ||
+ $profilingContext | ||
+ = str_replace( [ '*', '/' ], '-', $currentTitle->getPrefixedDBkey() ); | ||
+ } | ||
+ $rows = $query->buildAndSelect( $calcRows, $foundRows, $profilingContext ); | ||
if ( $rows === false ) { | ||
// This error path is very fast (We exit immediately if poolcounter is full) | ||
// Thus it should be safe to try again in ~5 minutes. |
31 changes: 31 additions & 0 deletions
31
_bluespice/patches/extensions/DynamicPageList3/includes/Query.php.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/includes/Query.php b/includes/Query.php | ||
index 879782c..24901d4 100644 | ||
--- a/includes/Query.php | ||
+++ b/includes/Query.php | ||
@@ -167,9 +167,10 @@ class Query { | ||
* | ||
* @param bool $calcRows | ||
* @param ?int &$foundRows | ||
+ * @param string $profilingContext Used to see the origin of a query in the profiling | ||
* @return array|bool | ||
*/ | ||
- public function buildAndSelect( bool $calcRows = false, ?int &$foundRows = null ) { | ||
+ public function buildAndSelect( bool $calcRows = false, ?int &$foundRows = null, $profilingContext = '' ) { | ||
global $wgNonincludableNamespaces, $wgDebugDumpSql; | ||
|
||
$options = []; | ||
@@ -363,10 +364,10 @@ class Query { | ||
$options['MAX_EXECUTION_TIME'] = $maxQueryTime; | ||
} | ||
|
||
- $parser = MediaWikiServices::getInstance()->getParser(); | ||
- $pageName = str_replace( [ '*', '/' ], '-', $parser->getTitle()->getPrefixedDBkey() ); | ||
- | ||
- $qname = __METHOD__ . ' - ' . $pageName; | ||
+ $qname = __METHOD__; | ||
+ if ( !empty( $profilingContext ) ) { | ||
+ $qname .= ' - ' . $profilingContext; | ||
+ } | ||
$where = $this->where; | ||
$join = $this->join; | ||
$db = $this->dbr; |