Page MenuHomePhabricator

The link from CU log to CU form (and vice versa) should preload the target
Closed, ResolvedPublic

Description

The link on top of the CU log which reads "Switch to CheckUser main form" should have the user preloaded in the URL

For instance, if you are viewing //wiki/w/index.php?title=Special:CheckUserLog&cuSearchType=target&cuSearch=1.2.3.4 that link should be to //wiki/w/index.php?title=Special:CheckUser&user=1.2.3.4 (currently it is just to //wiki/w/index.php?title=Special:CheckUser)

This allows running a check on that user without having to do a copy-and-paste

The opposite is also true for links from the CU page to the CU log page.

Event Timeline

Huji renamed this task from The link from CU log to CU form should preload the target to The link from CU log to CU form should preload the target and vice versa.Aug 30 2017, 6:20 PM
Huji updated the task description. (Show Details)

Change 374851 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/extensions/CheckUser@master] The link from CU log to CU and vice versa should preload the target

https://gerrit.wikimedia.org/r/374851

Huji renamed this task from The link from CU log to CU form should preload the target and vice versa to The link from CU log to CU form (and vice versa) should preload the target.Aug 30 2017, 6:21 PM

What about something like below?

specials/SpecialCheckUser.php    | 8 +++++++-
 specials/SpecialCheckUserLog.php | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 9357cc6..0a0fc32 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -33,9 +33,15 @@ class CheckUser extends SpecialPage {
 
 		if ( $this->getUser()->isAllowed( 'checkuser-log' ) ) {
 			$subtitleLink = $this->getLinkRenderer()->makeKnownLink(
-				SpecialPage::getTitleFor( 'CheckUserLog', $user ),
+				SpecialPage::getTitleFor( 'CheckUserLog' ),
 				$this->msg( 'checkuser-showlog' )->text()
 			);
+			if ( !$user === false ) {
+				$subtitleLink = $subtitleLink . ' | ' . $this->getLinkRenderer()->makeKnownLink(
+					SpecialPage::getTitleFor( 'CheckUserLog', $user ),
+					$this->msg( 'checkuser-contribs-log' )->text()
+				);
+			}
 			$out->addSubtitle( $subtitleLink );
 		}
 
diff --git a/specials/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
index 4f8ceef..ca432bd 100644
--- a/specials/SpecialCheckUserLog.php
+++ b/specials/SpecialCheckUserLog.php
@@ -20,9 +20,15 @@ class SpecialCheckUserLog extends SpecialPage {
 
 		if ( $this->getUser()->isAllowed( 'checkuser' ) ) {
 			$subtitleLink = $this->getLinkRenderer()->makeKnownLink(
-				SpecialPage::getTitleFor( 'CheckUser', $this->target ),
+				SpecialPage::getTitleFor( 'CheckUser' ),
 				$this->msg( 'checkuser-showmain' )->text()
 			);
+			if ( !$this->target === false ) {
+				$subtitleLink = $subtitleLink . ' | ' .$this->getLinkRenderer()->makeKnownLink(
+					SpecialPage::getTitleFor( 'CheckUser', $this->target ),
+					$this->msg( 'checkuser-check' )->text()
+				);
+			}
 			$out->addSubtitle( $subtitleLink );
 		}

What is the advantage, @Melos? To me they seem pretty equal.

My idea is to have something like in special:contributions with two separate links: the old one is usefull to switch in a empty CU form/log and vice versa, the new one (displayed only if there is a user param set) is for the user investigation.

What is the advantage, @Melos? To me they seem pretty equal.

So if no user param set then show one link and if the user param is set then show two links?

So if no user param set then show one link and if the user param is set then show two links?

Correct, that is my idea that comes from my CU usage.

Gotcha. And can you please tell me where in Special:Contributions do we have this kind of functionality (i.e. a second user-specific link shown only when user is provided?)

https://meta.wikimedia.org/wiki/Special:Contributions and https://meta.wikimedia.org/wiki/Special:Contributions/melos
For Melos (talk | block | block log | suppressed user contributions | uploads | logs | deleted user contributions | user rights management | rename user | mass delete | abuse log | recent user checks)

I think should be usefull to have something like "Switch to CheckUser log" and when there is a target something like
Switch to CheckUser log | recent user checks | Globalblock log | centralauthlog | whatelse

Change 374851 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] The link from CU log to CU and vice versa should preload the target

https://gerrit.wikimedia.org/r/374851

Huji claimed this task.
Huji removed a project: Patch-For-Review.