Benutzer:StipenTreublatt/Bugfixes für MediaWiki

aus Wiki Aventurica, dem DSA-Fanprojekt
Wechseln zu: Navigation, Suche
Crystal Clear app ark2.png
Archiv

MW 1.25.2

Extension:MultiBoilerplate (2.1.0)

Feature by Orci, MultiBoilerplate.hooks.php

Ergänze

        $content = preg_replace( '#<pre>(.*?)</pre>#ims', '$1', $content );
        $content = preg_replace( '#<nowiki>(.*?)</nowiki>#ims', '$1', $content );

direkt vor

	$editPage->textbox1 = $content;
Bugfix (Hack?) by Stip, MultiBoilerplate.hooks.php
(behobenes Problem: Es ist wieder möglich, Boilerplates per MediaWiki:Multiboilerplate zu definieren, wenn in den localsettings keine angegeben sind)

Ersetze

		if ( is_array( $wgMultiBoilerplateOptions ) ) {

durch

		if ( !empty( $wgMultiBoilerplateOptions ) ) {
Bugfix (Hack?) by Stip, SpecialBoilerplates.php
(behobenes Problem: auf MediaWiki:Multiboilerplate definierte Boilerplates werden wieder auf Spezial:Verfügbare Textvorlagen (Special:Boilerplates) angezeigt, wenn in den localsettings keine angegeben sind)

Ersetze

		if ( is_array( $wgMultiBoilerplateOptions ) ) {

durch

		if ( !empty( $wgMultiBoilerplateOptions ) ) {

Ersetze

			$things = explode( "\n", str_replace( "\r", "\n", str_replace(
				"\r\n", "\n", wfMessage( 'multiboilerplate' )
			) ) ); // Ensure line-endings are \n

durch

			$things = wfMessage( 'multiboilerplate' )->inContentLanguage()->text();
			$things = explode( "\n", str_replace(
				"\r", "\n", str_replace( "\r\n", "\n", $things )
			) ); // Ensure line-endings are \n

Extension:Favorites (1.1.2)

Bugfix by Stip based on AdminLinks_body.php of Extension:Admin Links, FavoritesHooks.php
behobenes Problem: Funktion, die den Link auf Spezial:Favoritelist in die persönlichen Links einfügt, verändert die keys der anderen Einträge.

Ersetze

		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;
		}

durch

    //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];
			}
		}

Extension:Multi-Category Search (1.67)

Bugfix by Stip, MultiCategorySearch_body.php
behobenes Problem: Veraltete Methoden, Systemmeldungen zu generieren, ersetzt (siehe deprecated wfMsg* functions und Output modes and escaping).

Ersetze alle Vorkommen von

wfMsg( 'somekey' )

und

wfMsgHtml( 'somekey' )

durch

wfMessage( 'somekey' )->escaped()

('somekey' natürlich passend ersetzen)
Zusätzlich kann man

$msgComment = wfMsgHtml( 'multicatsearch_comment' );

durch

$msgComment = wfMessage( 'multicatsearch_comment' )->text();

ersetzen, wenn man Wikitext-Formatierungen in MediaWiki:Multicatsearch comment zulassen will.

Extension:CentralAuth (Version?)

Bugfix by Stip based on answer by Matt Lord to bug report, central-auth.sql
behobenes Problem: Da uft8-Zeichen doppelt so viele bytes einnehmen, erscheint die Fehlermeldung "ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes" bei einigen der sql-Aufrufe in dieser Datei.

Ersetze

CREATE TABLE /*_*/localnames (
  ln_wiki varchar(255) binary not null,
  ln_name varchar(255) binary not null,
 
  primary key (ln_wiki, ln_name)
) /*$wgDBTableOptions*/;
 
CREATE INDEX /*i*/ln_name_wiki ON /*_*/localnames (ln_name, ln_wiki);

durch

CREATE TABLE /*_*/localnames (
  ln_wiki varchar(255) binary not null,
  ln_name varchar(255) binary not null,
 
  primary key (ln_wiki(100), ln_name(200))
) /*$wgDBTableOptions*/;
 
CREATE INDEX /*i*/ln_name_wiki ON /*_*/localnames (ln_name(200), ln_wiki(100));

sowie

CREATE INDEX /*i*/gu_hidden ON /*_*/globaluser ( gu_name(255), gu_hidden(255) );

durch

CREATE INDEX /*i*/gu_hidden ON /*_*/globaluser ( gu_name(255), gu_hidden(100) );

sowie

  primary key (lu_wiki, lu_name)
) /*$wgDBTableOptions*/;
 
CREATE INDEX /*i*/lu_name_wiki ON /*_*/localuser (lu_name, lu_wiki);

durch

  primary key (lu_wiki(100), lu_name(200))
) /*$wgDBTableOptions*/;
 
CREATE INDEX /*i*/lu_name_wiki ON /*_*/localuser (lu_name(200), lu_wiki(100));

sowie

  PRIMARY KEY (ggp_group, ggp_permission)
) /*$wgDBTableOptions*/;

durch

  PRIMARY KEY (ggp_group(100), ggp_permission(200))
) /*$wgDBTableOptions*/;

sowie

CREATE UNIQUE INDEX /*i*/ru_oldname ON /*_*/renameuser_status (ru_oldname, ru_wiki);

durch

CREATE UNIQUE INDEX /*i*/ru_oldname ON /*_*/renameuser_status (ru_oldname(200), ru_wiki(100));

sowie

CREATE INDEX /*i*/rq_oldstatus ON /*_*/renameuser_queue (rq_name, rq_wiki, rq_status);

durch

CREATE INDEX /*i*/rq_oldstatus ON /*_*/renameuser_queue (rq_name(200), rq_wiki(100), rq_status);

sowie

CREATE UNIQUE INDEX /*i*/utr_user ON /*_*/users_to_rename (utr_name, utr_wiki);

durch

CREATE UNIQUE INDEX /*i*/utr_user ON /*_*/users_to_rename (utr_name(200), utr_wiki(100));