Open main menu

Extension talk:Favorites

About this board

Bugged display in Installation section

2
134.106.87.67 (talkcontribs)

Is it just me or is the Installation section bugged? I see things like

1>download-link</> and place the file(s) in a directory called <tvar|name>Favorites</> in your <tvar|ext>extensions/</> folder.</translate>

Can someone fix this? Also the download link is not given!

Jlemley (talkcontribs)

Fixed - thank you!

Undefined method User::getSkin() in MW 1.28

1
TyrelHa (talkcontribs)

We recently upgraded to MW 1.28.0 from 1.25.0, and we're getting this error when trying to access the "My favorites" page:

PHP Fatal error:  Call to undefined method User::getSkin() in /srv/www/devwiki/extensions/Favorites/SpecialFavoritelist.php on line 94

This results in a 500 Internal Server Error and all users cannot access their favorites.

The method User::getSkin has been deprecated since 1.18. The code comment says to "use ->getSkin() in the most relevant outputting context you have."

I changed all instances of $this->user->getSkin() to $this->context->getSkin() on my copy of the extension, and now it seems to work fine.

Reply to "Undefined method User::getSkin() in MW 1.28"

i18n - German Translation available

3
195.182.60.200 (talkcontribs)

With this post I provide a german translation of the en.json file provided within the favorites project. Perhaps it can be part of the project source.

Please feel free to add this as "de.json" in the folder Favorites/i18n/:

{

   "@metadata": {
       "authors": ["Tim Koester"]
   },
   "favorites-desc": "Erstelle Favoriten-Liste",
   "favoritethis"                       : "Zu Favoriten hinzufügen",
   "prefs-favoritelist"              : "Favoriten",
   "prefs-favoritelist-token"        : "Favoriten token:",
   "prefs-advancedfavoritelist"      : "Erweiterte Optionen",
   "favoritelist"           : "Favoriten",
   "myfavoritelist"         : "Favoriten",
   "favoritelistfor"        : "(for $1)",
   "nofavoritelist"         : "You have no items in your favorites.",
   "favoritelistanontext"   : "Bitte $1 um Favoriten anzuzeigen oder zu bearbeiten.",
   "favoritenologin"        : "Anmeldung erforderlich",
   "favoritenologintext"    : "Sie müssen angemeldet sein, um mit Favoriten zu arbeiten.",
   "addedfavorite"          : "Zu Favoriten hinzugefügt",
   "addedfavoritetext"      : "Die Seite $1 wurde zu ihren Favoriten hinzugefügt.",
   "removedfavorite"        : "Aus Favoriten entfernt",
   "removedfavoritetext"    : "Die Seite $1 wurde aus ihren Favoriten entfernt.",
   "favorite"               : "+Favorit",
   "favoritethispage"       : "Zu Favoriten hinzufügen.",
   "unfavorite"             : "-Favorit",
   "unfavoritethispage"     : "Aus Favoriten entfernen.",
   "favoritelist-options"   : "Favoriten Optionen",
   "favoriteerrortext"         : "Ein Fehler trat auf beim Ändern der Favoriten Einstellungen für $1.",
   "unfavoriteing"             : "Entfernen ...",
   "favoriteing"             : "Hinzufügen ...",
   "tooltip-pt-favoritelist": "Liste der Seite, deren Änderungen sie überwachen.",
   "tooltip-ca-favorite"      : "Fügt diese Seite zu ihren Favoriten hinzu.",
   "tooltip-ca-unfavorite"  : "Entfernt diese Seite aus ihren Favoriten.",
   "tooltip-favorite"          : "Fügt diese Seite zu ihren Favoriten hinzu.",
   "favoritelistedit-numitems"    : "Ihre Favoritenliste enthält $1 Titel.",
   "favoritelistedit-noitems" : "Your favorites contain no titles.",
   "favoritelistedit-normal-title" : "Favoriten bearbeiten",
   "favoritelistedit-normal-legend" : "Titel aus den Favoriten entfernen",
   "favoritelistedit-normal-explain" : "Titel in den Favoriten werden unten angezeigt. 
Zu entfernende Titel mittels Checkbox markieren und mit Button '<Favoritelistedit-normal-submit>' entfernen.
Alternativ können Sie den Quelltext editieren.
", "favoritelistedit-normal-submit" : "Titel entfernen", "favoritelistedit-normal-done" : "$1 titles were removed from your favorites:", "favoritelistedit-raw-title" : "Quelltext der Favoritenliste bearbeiten", "favoritelistedit-raw-legend" : "Quelltext bearbeiten", "favoritelistedit-raw-explain" : "Dit Titel ihrer Favoritenliste werden unten angezeigt. Sie können Titel aus der Liste löschen oder auch weitere Titel hinzufügen. Jeder Titel steht dabei einzeln in einer Zeile.
Nach Abschluss der Bearbeitung auf Button '<Favoritelistedit-raw-submit>' klicken.

Sie können auch die normale Bearbeitungsseite wählen.
", "favoritelistedit-raw-titles" : "Titel:", "favoritelistedit-raw-submit" : "Favoriten aktualisieren", "favoritelistedit-raw-done" : "Ihre Favoriten wurden aktualisiert.", "favoritelistedit-raw-added" : "$1 Titel wurde hinzugefügt:", "favoritelistedit-raw-removed" : "$1 Titel wurde entfernt:", "favoritelisttools-view" : "Favoriten anzeigen", "favoritelisttools-edit" : "Favoriten anzeigen und bearbeiten", "favoritelisttools-raw" : "Favoriten Quelltext bearbeiten"

}

Shirayuki (talkcontribs)
Jkmartindale (talkcontribs)

I just sent a commit to Gerrit. Now we just gotta wait for it to be merged. Thanks for your work!

Reply to "i18n - German Translation available"
Baumgeist (talkcontribs)

(really hating this discussion system) Setting $wgFavoritesPersonalURL = true; messes up the keys of the other links, so I copied some code from Extension:AdminLinks to fix that. Find:

		if ( $wgFavoritesPersonalURL && $wgUser->isLoggedIn() ) {
			$url['userpage'] = array_shift( $personal_urls );
			$url[] = array_shift( $personal_urls );
			$url[] = array_shift( $personal_urls );
	
			$url[] = array( 'text' => wfMessage( 'myfavoritelist' )->text(),
					'href' => SpecialPage::getTitleFor( 'Favoritelist' )->getLocalURL() );
			$personal_urls = $url + $personal_urls;
		}

Replace with:

    //taken from AdminLinks_body.php of the AdminLinks-Extension
		if ( $wgFavoritesPersonalURL && $wgUser->isLoggedIn() ) {
			$al = SpecialPage::getTitleFor( 'Favoritelist' );
			$href = $al->getLocalURL();
			$favorites_vals = array(
				'text' => wfMessage( 'myfavoritelist' )->text(),
				'href' => $href,
				'active' => ( $href == $wgTitle->getLocalURL() )
			);

			// find the location of the 'my preferences' link, and
			// add the link to 'AdminLinks' right before it.
			// this is a "key-safe" splice - it preserves both the
			// keys and the values of the array, by editing them
			// separately and then rebuilding the array.
			// based on the example at http://us2.php.net/manual/en/function.array-splice.php#31234
			$tab_keys = array_keys( $personal_urls );
			$tab_values = array_values( $personal_urls );
			$watch_location = array_search( 'watchlist', $tab_keys );
			array_splice( $tab_keys, $watch_location, 0, 'Favoritelist' );
			array_splice( $tab_values, $watch_location, 0, array( $favorites_vals ) );

			$personal_urls = array();
			for ( $i = 0; $i < count( $tab_keys ); $i++ ) {
				$personal_urls[$tab_keys[$i]] = $tab_values[$i];
			}
		}

Jkmartindale (talkcontribs)

I did something similar. To add the Favorites link after the Watchlist link, all you need to do is edit FavoritesHooks.php from

 92 public static function onPersonalUrls( &$personal_urls, &$title ) {
 93 	global $wgFavoritesPersonalURL, $wgUser;
 94 
 95 	if ( $wgFavoritesPersonalURL && $wgUser->isLoggedIn() ) {
 96 		$url['userpage'] = array_shift( $personal_urls );
 97 		$url[] = array_shift( $personal_urls );
 98 		$url[] = array_shift( $personal_urls );
 99 
100 		$url[] = array( 'text' => wfMessage( 'myfavoritelist' )->text(),
101 				'href' => SpecialPage::getTitleFor( 'Favoritelist' )->getLocalURL() );
102 		$personal_urls = $url + $personal_urls;
103 	}
104 
105 	return true;
106 }

to

 92 public static function onPersonalUrls( &$personal_urls, &$title ) {
 93 	global $wgFavoritesPersonalURL, $wgUser;
 94 
 95 	if ( $wgFavoritesPersonalURL && $wgUser->isLoggedIn() ) {
 96 		$url[] = array( 'text' => wfMessage( 'myfavoritelist' )->text(),
 97 				'href' => SpecialPage::getTitleFor( 'Favoritelist' )->getLocalURL() );
 98 		$personal_urls = wfArrayInsertAfter( $personal_urls, $url, 'watchlist' );
 99 	}
100 
101 	return true;
102 }
Reply to "Bugfix"

Call to undefined function wfMsg()

4
Summary by Jkmartindale

Fixed in r262067

Mkepler (talkcontribs)

Mediawiki 1.27

PHP Fatal error:  Call to undefined function wfMsg() in /path/to/wiki/extensions/Favorites/FavParser.php on line 32

Mkepler (talkcontribs)

Cause: edit page, and submit.

Mkepler (talkcontribs)

Solution: replace wfMsg wfMessage

Mkepler (talkcontribs)

Error on Empty Favorites List [MW1.27.1]

2
Jkmartindale (talkcontribs)

I created an empty page with <favorites editlink=true /> when I had an empty favorites list, and it resulted in Error from line 145 of extensions/Favorites/FavParser.php: Call to undefined method FavParser::msg().

Jkmartindale (talkcontribs)
Solution

Edit line 145 of FavParser.php:

138 private function showNormalForm( $output, $user ) {
139 
140 	if ( $this->countFavoritelist($user ) > 0 ) {
141 		$form = $this->buildRemoveList( $user );
142 		$output .=  $form ;
143 		return $output;
144 	} else {
145 		$output = $this->msg('nofavoritelist')->text();
146 		return $output;
147 	}
148 }

to

145 		$output = wfMessage('nofavoritelist')->text();
Reply to "Error on Empty Favorites List [MW1.27.1]"

$wgUseIconFavorite and $wgFavoritesPersonalURL don't work!

3
Fokebox (talkcontribs)

1) $wgUseIconFavorite = true; and $wgFavoritesPersonalURL = true; dont't work at my wiki! I use Mediawiki 1.18.3 2) Shall I launch update.php after installation, if I have updated mysql manually? What do I have to do?

Fokebox (talkcontribs)

Well it does work =) I had worng order in php ) But it is displayed not like on the screen shot of the example page

Add caption here

I have marked a red line what looks wrong There is also a strange line in the bottom of my favorite page

Add caption here

And I had to chage SpecialFavoritelist.php ('Xml::hidden' to 'Html::hidden'), 'caouse there was a php error.

Fokebox (talkcontribs)

Well it does work =) I had worng order in php ) But it is displayed not like on the screen shot of the example page

Add caption here

I have marked a red line what looks wrong There is also a strange line in the bottom of my favorite page

Add caption here

And I had to chage SpecialFavoritelist.php ('Xml::hidden' to 'Html::hidden'), 'caouse there was a php error.

Reply to "$wgUseIconFavorite and $wgFavoritesPersonalURL don't work!"

Hook TitleMoveComplete broken in MW 1.27.1

1
Subfader (talkcontribs)
Reply to "Hook TitleMoveComplete broken in MW 1.27.1"
Subfader (talkcontribs)
undefined method User::getSkin()

https://www.mediawiki.org/wiki/Release_notes/1.27 > User::getSkin() was removed (deprecated since 1.18)

In SpecialFavoritelist.php just change $this->user-getSkin() to $this->user

undefined method User::editToken()

InFavoritelistEditor.php just change $user->editToken() to $user->getEditToken()

Reply to "MW 1.27 errors"
Abhidevananda (talkcontribs)

$wgVectorUseIconWatch = false; It does not seem to work (in localsettings.php) MW1.25.1. Any suggestions?

Reply to "How to remove star icon?"
Return to "Favorites" page.