Jump to content

Extension talk:User Contact Links

Add topic
From mediawiki.org
Latest comment: 14 years ago by Robinson Weijman in topic Improvement Suggestion - change text on page

MW 1.8.3

[edit]

Problem: The extension does not work in MW 1.8.3, producing following error in server error log:

PHP Fatal error:  Call to undefined method User::newfromid() in .../extensions/UserSignature.php on line 32

Step 1: Add the following function to the end of UserSignature.php:

function newFromId( $id ) {
   $u = new User;
   $u->mId = $id;
   $u->mFrom = 'id';
   return $u;
}

Step 2: Replace line 32 in UserSignature.php.

Old line:

$u = User::newFromId($userid);

New line:

$u = newFromId($userid);

Have fun! Khitrenovich 10:30, 8 November 2007 (UTC)Reply

Thanks for the suggestion. I have implemented this and committed the changes to SNV. --Gri6507 14:06, 8 November 2007 (UTC)Reply
Nice, 10x! Khitrenovich 17:06, 8 November 2007 (UTC)Reply

Extension URL

[edit]

Also, it may be a good idea to add URL to $wgExtensionCredits, so it will be visible in Special:Version page:

'url' => 'http://www.mediawiki.org/wiki/Extension:User_Contact_Links'

--Khitrenovich 17:05, 8 November 2007 (UTC)Reply

Thanks for the suggestion. I just added it to SVN. --Gri6507 02:21, 11 November 2007 (UTC)Reply

"Undefined offset:" error on MW 1.11

[edit]

I'm trying to use this extension with MW 1.11 and I'm getting this error on top of page when trying to access Special:Version page:

Notice: Undefined offset: 1 in [strip]/wiki/extensions/UserContactLinks/UserSignature.php on line 79

Ipse 13:51, 26 January 2008 (UTC)Reply

Thanks for pointing this out. The issue here is two fold:
  1. the user for which this error message is generated does not seem to have a realname in the form of "first_name last_name". I guess I made that assumption when I wrote that code since in a corporate environment (which was the target of my extension) this should never happen.
  2. your PHP error reporting level is set to E_ALL or some other equivalently high level. In a typical installation, PHP does not report any messages for E_NOTICE. That's why I, and probably many other users have not seen this problem so far.
In any case, I have fixed this issue in the newly released version 0.4.1 which is in SVN now. Can you please give it a try and let me know if it addresses your problem? --Gri6507 16:37, 27 January 2008 (UTC)Reply
Yes, I had name which is not separable to two parts. After update notice've disappeared, thank you! - Ipse 18:01, 27 January 2008 (UTC)Reply

Improvement Suggestion - change text on page

[edit]

I think this is a great extension - it does a super job of "guessing" the right user. But why not change the text on save, like a signature changes. So, change:

^^^name^^^

to

[[User:Name|talk]] (or exact text as determined by MediaWiki).

--Robinson Weijman 10:57, 11 March 2010 (UTC)Reply