Extension talk:Realnames

From MediaWiki.org
Jump to: navigation, search

[edit] Speed Issues

There is (I have) some concern over speed issues. While I wasn't able to observe it on my wiki, with large RecentChanges or History pages with a lot of username->realname conversions/lookups (by as many different users as possible) it could start to slow down. We have potentially 500 unique realname lookups for a single page hit. If you experience this on your wiki, please let me know, I have a few strategies to combat this. The first will be to change from using the User:newFromName() core lookup and first compiling a list of usernames to look up, and doing them all at once in a single direct db hit on the users table. This would speed up name lookups on all pages but tie us more closely into base core components (I may do this anyways in a future version). The next strategy would be to hook into these two specific high use pages (perhaps All Users as well), and add to their queries so as they get data they also get the real name for display. I've already coded this for History, OldRecentChanges, EnhancedRecentChanges and AllUsers, but haven't included it in yet, it would increase the size/complexity a fair amount. The good news that all of these improvements can act as layers. We can do hook-based lookups for high-use places, than fallback on the more general article content search for any straglers (like Revisions, Comparison, user-created links). Please let me know what your experience is! --Quadir 17:59, 19 September 2011 (UTC)

[edit] Realname links

If you use the default style 'replace', users (especially non-tech) users won't be able to find someone's username very easily. Infact the only place you can find it is in the URL, under the form 'User:username' because all displays will be of their real names. This makes manual linking to a user cumbersome. I can see two avenues of attack to this problem, the first may be to change the default style to something like 'append' or 'reverse'. Please let me know if you prefer a different default style (although this will affect people already using the extension). The 2nd avenue, and one I will probably pursue anyways is looking at $linker to see if I could allow users to do [User:realname] links in articles. Even if it involves doing another search and replace of realname->username or hooking's the lookup to be username OR realname. This could produce some weird collisions since realnames are not unique, and usernames+realnames definitely aren't, however as a togglable option it may make a 'replace' style wiki more usable in the long. Please let me know your thoughts! --Quadir 18:07, 19 September 2011 (UTC)

[edit] User Issues

Please use the "Start a new discussion" link bellow to start a new topic about your issue or suggestion.


Start a new discussion

Contents

Thread titleRepliesLast modified
Replaces Users with s107:55, 23 April 2012
Realnames_0.3_2011-11-05 fails on MW 1.18404:01, 13 April 2012
Realnames 0.3.1 page titel and body problem315:09, 9 March 2012
Unknown Modifier Error on Subpages010:10, 12 January 2012
Problem in 0.3212:18, 30 December 2011
Block Page Title Conversion1120:32, 25 December 2011

Replaces Users with s

I noticed that this extension replaces the link [[Users]] with (on the page) "s" (without quotes) which links to the Users page. Note that this does not happen with:

[[users]]
[[ Users]]

What is the cause?

Robinson Weijman13:30, 7 February 2012

Does anyone know how to solve this? Olivier has not responded to my question or emails. :(

Robinson Weijman (talk)07:55, 23 April 2012
 

Realnames_0.3_2011-11-05 fails on MW 1.18

I'm getting Parse error: syntax error, unexpected T_STATIC in C:\wiki\htdocs\wiki\extensions\Realnames\Realnames.body.php on line 85

Vgold22:15, 23 December 2011

I'm not exactly sure if I fixed your problem, but could you please try 0.3.1 and let me know? I finally got my environment back up, and I've got it working on all wiki version back to 1.15.x

If it doesn't fix it, could you please give me the new error message/line num, as well as what version of PHP you are running?

Thanks for reporting the problem! I'll get it fixed ASAP either way.

Olivier Beaton20:31, 25 December 2011

Hi, I'm also getting this error with 0.3.1. Here is my enviroment:

Product Version
MediaWiki 1.17.0
PHP 5.1.6 (apache2handler)
MySQL 5.0.77

|- ! Header text !! Header text !! Header text |- | Example || Example || Example |- | Example || Example || Example |- | Example || Example || Example

And the error message: PHP Parse error: syntax error, unexpected T_STATIC in /var/www/html/mw/extensions/Realnames/Realnames.body.php on line 80

202.36.134.2200:05, 5 April 2012
 

Same error as others
Parse error: syntax error, unexpected T_STATIC in /homepages/obfuscation/htdocs/mediawiki/extensions/Realnames/Realnames.body.php on line 80

Environment

  • MediaWiki 1.18
  • PHP 5.2.17
  • Realnames 0.3.1 (2011-12-25)

LocalSettings.php
require_once("$IP/extensions/Realnames/Realnames.php");
$wgRealnamesLinkStyle = "append";

Users are clamoring for Real Names to be visible.

67.253.177.17219:52, 7 April 2012
 

i've got the same error. MediaWiki 1.18.0 PHP 5.2.17 (ucgi5) MySQL 5.5.21-log Parse error: syntax error, unexpected T_STATIC in /polish/extensions/Realnames/Realnames.body.php on line 80

77.255.108.17213:03, 27 February 2012
 

Realnames 0.3.1 page titel and body problem

First I got to say I am working in Austria.

I am running MW 1.18.0 with Realnames 0.3.1 and my problem is that every page titel in the header/body that starts with "Benutzer" is replaced to nothing. E.g "Benutzeroberflächen" is displayed as "oberflächen".

I also expected a problem with Realnames at the recent changes page: The usernames are not displayed with their realnames.

Greg09:03, 11 January 2012

Thanks for letting me know, I'll definitely look at this. Can you tell me what language you've set your wiki to? I'm not talking about the user language but the sitewide one set in LocalSettings.php so I can test. Thanks!

Olivier Beaton12:46, 11 January 2012

Hey! I have set $wgLanguageCode = "de"; in my LocalSettings.php

Thanks for your very quick reply!

Greg10:37, 19 January 2012

It's the same with English language code ( $wgLanguageCode = "en"; ) and User* pages.
As User:Robinson_Weijman already mentioned, with [[user*]] and [[ User*]] (or for German: [[benutzer*]] and [[ Benutzer*]]) at least the links will work. The page title will still be cut off.

194.107.228.25115:09, 9 March 2012
 
 
 

Unknown Modifier Error on Subpages

I am running Realnames v0.3.1 with the default options.

When navigating to a sub-page of a user's page (e.g. /User:somename/Subpage) an 'Unknown modifier' error is generated by preg_replace_callback() in lookForBare().

I have fixed this in our installation by changing the delimiters for the regex from '/' to '~' in the following two places in Realnames.body.php:

268 - $out->setPagetitle(static::lookForBare($out->getPageTitle(),'/'.static::getNamespacePrefixes().'\s*('.$title->getText().')(?:\/.+)?/'));
268 + $out->setPagetitle(static::lookForBare($out->getPageTitle(),'~'.static::getNamespacePrefixes().'\s*('.$title->getText().')(?:/.+)?~'));
334 - $pattern = '/'.static::getNamespacePrefixes().'([^ \t]+)(:\/.+)?/';
334 + $pattern = '~'.static::getNamespacePrefixes().'([^ \t]+)(:/.+)?~';

I have not yet noticed this breaking anything else but will post again if I notice anything.

H.Mills10:10, 12 January 2012

Problem in 0.3

I had to fix the namespace to get users recognized:

-     static::$namespacePrefixes = '(?:'.implode('|',$namespaces).':)';
+     static::$namespacePrefixes = '(?:'.implode('|',$namespaces).'):';

Cweiske 13:18, 15 December 2011 (UTC)

Olivier Beaton19:24, 25 December 2011

Could you please try 0.3.1 and let me know if you have the same issue? The fix in the end was not as easy as you mentioned.

Olivier Beaton20:29, 25 December 2011

> Could you please try 0.3.1 and let me know if you have the same issue Yes, I still have the same problem with 0.3.1. 0.3.0 with my patch makes it work for me.

I'm specifically having the problem that [[User:christian.weiske]] in the text does not get replaced with my name.

Cweiske12:18, 30 December 2011
 
 

Block Page Title Conversion

Great extension, I wish I knew about it about 132 internal users ago, but still, it's very useful. However, I have some oldtimers who have their first name matching their login name (like "John"). So home page titles went from "John Smith" to "John Smith Smith" or from "John Jones" to "John Smith Jones".

Salquint23:20, 30 September 2011

Here's the patch in case you have an IT department that forces you to be interested:

Index: Realnames.body.php
===================================================================
--- Realnames.body.php  (revision 223)
+++ Realnames.body.php  (revision 226)
@@ -278,7 +278,7 @@
    * @note requires MediaWiki 1.7.0      
    */     
   public static function hookBeforePageDisplay(&$out, &$sk = false) {
-    global $wgTitle;
+    global $wgTitle, $wgRealnamesPageTitle;
     
     // pre 1.16 no getTitle()
     $title = method_exists($out,'getTitle') ? $out->getTitle() : $wgTitle;
@@ -294,8 +294,10 @@
     if (self::debug()) {
       echo "hookBeforePageDisplay: searching article title...<br>\n";          
     }
-    // this should also affect the html head title
-    $out->setPageTitle(self::lookForBare($out->getPageTitle()));
+    if ( $wgRealnamesPageTitle ) {
+      // this should also affect the html head title
+      $out->setPageTitle(self::lookForBare($out->getPageTitle()));
+    }
 
     // subtitle (say, on revision pages)
     if (self::debug()) {


Index: Realnames.php
===================================================================
--- Realnames.php       (revision 223)
+++ Realnames.php       (revision 226)
@@ -107,6 +107,12 @@
  */ 
 $wgRealnamesNamespaces = array();
  
+/**
+ * Used to block the conversion of Page titles (when set to false)
+ * @since 2011-09-350 0.1
+ */ 
+$wgRealnamesPageTitle = true;
+
 if (isset($wgConfigureAdditionalExtensions) && is_array($wgConfigureAdditionalExtensions)) {
 
   /* (not our var to doc)
@@ -121,6 +127,7 @@
           'wgRealnamesBlank' => 'bool',
           'wgRealnamesStyles' => 'array',   
           'wgRealnamesNamespaces' => 'array',     
+          'wgRealnamesPageTitle' => 'bool',
       ),
       'array' => array(
           'wgRealnamesStyles' => 'assoc',

To block page title conversions, set $wgRealnamesPageTitle to false in LocalSetttings.php. Otherwise, it works as intended.

Salquint23:48, 30 September 2011

Hi Salquint, I'm happy to hear you're liking the extension, and thanks for the patch! While it's obvious it lets you opt-out of replacing the page title, I was wondering if you could send me a few other details about why this is happening for you. If a user sets their real name to 'John' and their username is 'John Smith', with a 'replace' style you will only see 'John'. With an append style you will see 'John Smith - John'. Is that what you meant? I remember writting a patch for Extension:ShowRealUsernames a long way back to make it so that if their username == realname, then don't use the append style. I had completely forgotten it until now! So I'll definitely be adding something in for that in the next version. Back to your problem though, could you please elaborate? Thanks a bunch!

Quadir01:17, 1 October 2011

Sorry for the late reply, silly work gets in the way. I encountered it the other way. In my situation:

  • Username - John
  • "Real name" in preferences - John Smith
  • Profile Page Name - "John Smith", not User:John, a John Smith page

After installing Realnames, viewing the profile page showed the title "John Smith Smith", presumably because the "John" in the title was replaced with Real name "John Smith"

Salquint02:50, 22 October 2011
 

Hi salquint, sorry for the delay. I've released version 0.3 which includes a new setting for which you can do $wgRealnamesReplacements['title'] = FALSE; in your LocalSettings to do the behaviour you describe above. Please let me know if it works for you. I still want to look more into the exact problem you were encountering though. I fixed a bug in title handling that may be related, can you give it a try (with titles enabled) and let me know if you see the same behaviour? If so, just disable title handling and I'll keep working on this.

Olivier Beaton21:13, 5 November 2011

Unless I'm doing something wrong, the source I get from this link:

is giving me 0.2.1 as the version. However, with this version my page titles now work correctly without using $wgRealnamesPageTitle = false.

Thanks.

Salquint17:54, 7 November 2011

Oh bother. Yes, that's the file. I forgot to change the version in Realnames.php (again!) I'm glad to hear your issue is resolved!

Olivier Beaton18:07, 7 November 2011

I tried to use the extension for MW 1.16.0. It didn't work. MW pages do not show up.

MSun01:29, 18 December 2011
 

I reinstalled MW (1.17.0). The extension didn't work. With the extension installed, MW pages do not show up. The error message is "The website cannot display the page".

MSun00:43, 19 December 2011
 
 
 
 
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox