// That does save the bulk of the query cost, but now we need to
// get a little more detail about each individual entry quickly
// using the filter of reallyGetQueryInfo.
// That does save the bulk of the query cost, but now we need to
// get a little more detail about each individual entry quickly
// using the filter of reallyGetQueryInfo.
- if ( $result && !isset( $result->b_namespace ) ) {
- $dbr = wfGetDB( DB_REPLICA );
- $qi = $this->reallyGetQueryInfo(
- $result->namespace,
- $result->title
- );
- $res = $dbr->select(
- $qi['tables'],
- $qi['fields'],
- $qi['conds'],
- __METHOD__
- );
-
- if ( $res ) {
- $result = $dbr->fetchObject( $res );
+ $deep = false;
+ if ( $result ) {
+ if ( isset( $result->b_namespace ) ) {
+ $deep = $result;
+ } else {
+ $dbr = wfGetDB( DB_REPLICA );
+ $qi = $this->reallyGetQueryInfo(
+ $result->namespace,
+ $result->title
+ );
+ $res = $dbr->select(
+ $qi['tables'],
+ $qi['fields'],
+ $qi['conds'],
+ __METHOD__
+ );
+
+ if ( $res ) {
+ $deep = $dbr->fetchObject( $res ) ?: false;
+ }
}
}
$titleA = Title::makeTitle( $result->namespace, $result->title );
$linkRenderer = $this->getLinkRenderer();
}
}
$titleA = Title::makeTitle( $result->namespace, $result->title );
$linkRenderer = $this->getLinkRenderer();
return '<del>' . $linkRenderer->makeLink( $titleA, null, [], [ 'redirect' => 'no' ] ) . '</del>';
}
// if the page is editable, add an edit link
if (
// check user permissions
return '<del>' . $linkRenderer->makeLink( $titleA, null, [], [ 'redirect' => 'no' ] ) . '</del>';
}
// if the page is editable, add an edit link
if (
// check user permissions
- $this->getUser()->isAllowed( 'edit' ) &&
+ MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->getUser(), 'edit' ) &&
// check, if the content model is editable through action=edit
ContentHandler::getForTitle( $titleA )->supportsDirectEditing()
) {
// check, if the content model is editable through action=edit
ContentHandler::getForTitle( $titleA )->supportsDirectEditing()
) {
*/
function preprocessResults( $db, $res ) {
if ( !$res->numRows() ) {
*/
function preprocessResults( $db, $res ) {
if ( !$res->numRows() ) {