Fix caller name in Title::loadRestrictions
authorUmherirrender <umherirrender_de.wp@web.de>
Sat, 22 Sep 2018 13:47:03 +0000 (15:47 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 22 Sep 2018 13:47:03 +0000 (15:47 +0200)
Seeing {closure} in the logs as caller is not helpful

Change-Id: I34aead30c55aefb7591cbc6031522d0f0e5bd17a

includes/Title.php

index bbc1d63..369e15a 100644 (file)
@@ -3354,11 +3354,12 @@ class Title implements LinkTarget {
                $id = $this->getArticleID();
                if ( $id ) {
                        $cache = ObjectCache::getMainWANInstance();
+                       $fname = __METHOD__;
                        $rows = $cache->getWithSetCallback(
                                // Page protections always leave a new null revision
                                $cache->makeKey( 'page-restrictions', $id, $this->getLatestRevID() ),
                                $cache::TTL_DAY,
-                               function ( $curValue, &$ttl, array &$setOpts ) {
+                               function ( $curValue, &$ttl, array &$setOpts ) use ( $fname ) {
                                        $dbr = wfGetDB( DB_REPLICA );
 
                                        $setOpts += Database::getCacheSetOptions( $dbr );
@@ -3368,7 +3369,7 @@ class Title implements LinkTarget {
                                                        'page_restrictions',
                                                        [ 'pr_type', 'pr_expiry', 'pr_level', 'pr_cascade' ],
                                                        [ 'pr_page' => $this->getArticleID() ],
-                                                       __METHOD__
+                                                       $fname
                                                )
                                        );
                                }