I'm sure I'm not the first to have this issue, but I couldn't find the info I need in FAQs. I'm in the process of setting up a Wiki at knowledge.reconnect.org.uk, I'm currently mostly installing extensions etc. before posting the initial pages that are currently in desktop files that will need editing. All was going well until I attempted another update via http://knowledge.reconnect.org.uk/mw-config/index.php. I got the error message "Your session data was lost! Check your php.ini and make sure session.save_path
is set to an appropriate directory." How do I resolve this? I have MediaWiki 1.40.1 installed.
Project:Support desk
So, did you
Check your php.ini and make sure
session.save_path
is set to an appropriate directory.
?
The error message indicates that the session data can not be stored. This may be related to the mentioned configuration. There is also Manual:$wgSessionCacheType which may contain useful information, but I don't think it really applies to the web installer.
Hi Osnard, thanks for your quick response. Unfortunately, I don't currently have command line access - but that will get sorted in the next 24 hours. Perhaps I just need to wait for that?! I don't understand why the problem suddenly appeared, I was just setting up the ConfirmEdit Extension... as soon as I can, I'll check php.ini and post what I find here. Hopefully it'll be a solution. Thanks!
I got command access and it all seemed OK. My wiki was also all working fine. I then discovered I was making a stupid mistake! I'd set up a bookmark to access my update page at knowledge.reconnect.org.uk/mw-config/index.php but prefixed it with http:// instead of https://...
http://php 1.42.3
second post on here in four hours but the recent changes on my wiki only ever returns a HTTP200 when it checks if there has been any recent changes
on other wikis it will return a HTTP204 until there has been a new change that isn't displayed
no clue why this happens so any input is appreciated
my special pages have a different format to the default and i have no clue why
e.g. Special:EmailUser?wpTarget=TargetUsername does not work, but Special:EmailUser/TargetUsername does work
idk if it's relevant but below is the path setup
$wgScriptPath = "";
$wgScriptExtension = "$wgScriptPath/index.php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
foreach ($actions as $action) {
$wgActionPaths[$action] = "$wgArticlePath/$action";
}
$wgActionPaths["view"] = "/wiki/$1";
$wgActionPaths["rollback"] = "/index.php?title=$1&action=rollback";
After updating from 1.39 to 1.42.3 all pages with categories have the same problem:
When I open the page in the Visual Editor the existing categories are shown in the category box at the bottom of the page as red links with these urls; Index.php?title=Category:category name].
If I leave it like that then after saving the page that url shows up at the bottom of the page text and the page no longer has any categories.
If I use the Source Editor instead everything is fine and the category shows up between double brackets.
The steps I took to update:
I uploaded the 1.42.3 zip to the server, had it unzipped to a new directory. I downloaded the latest versions for LabeledSectionTransclusion and Popups and uploaded those to the Extensions folder in the new directory.
I renamed the 1.39 folder to another name and then renamed the 1.42.3 folder to the regular wiki name. Then I ran the update script.
I opened the wiki main page and then saw I forgot to copy the images directory to the new folder, which is what I did next. I then reloaded the main page and everything looked fine.
The first time I edited a page I didn't notice the error at the bottom but after saving I saw what happened and from then on it became clear this is happening every time now.
I've tested by disabling all the extensions except for the editors to see if any of those could be the culprit but I keep getting the same issue.
These are the normally enabled extensions:
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'LabeledSectionTransclusion' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Popups' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
I did find the following in the release notes for 1.42:
ParserOutput::getCategories()
, deprecated in 1.40, has been removed. You should use ::getCategoryNames()
and ::getCategorySortKey()
instead.
Maybe that is related but I don't understand how it could be as all the other extensions except for the two mentioned above come bundled with the latest version and should be compatible, one would think.
Could it be something needs to be added or removed from LocalSettings?
I'd love to know what the fix for this is as I used categories on all pages.
Thanks!
Hello! My wiki's name is quite long (Craighead County History). The sitename overlaps with the search bar. How can I fix this? This wiki is hosted by Miraheze, if that information is helpful.
You should contact Miraheze about issues on wikis hosted by them.
I have built a Mediawiki 1.42.3 on the latest version of Rocky9 and imported my database from a previous version. Everything works except (Open)LDAP login which returns an error when I try to login. The strange thing is that the error is different if I clear my cookie cash. I know that LDAP is working because I can login at the OS level using sssd. Is there any way to debug this as the logs give me no clue?
These are my LocalSettings.php LDAP settings:
######### LDAP ########
#######################
# LDAP Extensions
######################
wfLoadExtensions( [
'PluggableAuth',
'Auth_remoteuser',
'LDAPProvider',
'LDAPAuthentication2',
'LDAPAuthorization',
'LDAPUserInfo'
] );
$LDAPAuthorizationAutoAuthRemoteUserStringParser = 'username-at-domain';
$LDAPAuthentication2UsernameNormalizer = 'strtolower';
$LDAPAuthentication2AllowLocalLogin = true;
$wgAuthRemoteuserAllowUserSwitch = true;
$wgPluggableAuth_EnableLocalLogin = true;
$wgAuthRemoteuserUserName = function() {
$user = '';
if( isset( $_SERVER[ 'REMOTE_USER' ] ) ) {
$user = strtolower( $_SERVER[ 'REMOTE_USER' ] );
}
return $user;
};
$LDAPProviderDomainConfigProvider = function() {
$config = [
'acmecorp.com' => [
'connection' => [
"server" => "auth.acmecorp.com",
"user": "cn=readonlyroot,dc=acme,dc=corp",
"pass": "PASSWD",
"options" => [
"LDAP_OPT_DEREF" => 1
],
"basedn" => "dc=acme,dc=corp",
"groupbasedn" => "ou=group,dc=acme,dc=corp",
"userbasedn" => "ou=people,dc=acme,dc=corp",
"searchattribute" => "uid",
"usernameattribute" => "uid",
"realnameattribute" => "fullname",
"emailattribute" => "mail",
"grouprequest" => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\GroupMember::factory"
],
'authorization' => [
'rules' => [
'groups' => [
'required' => [
'cn=readonlyroot,dc=acme,dc=corp'
]
]
]
],
'userinfo' => [
'attributes-map' => [
'email' => 'mail',
'realname' => 'fullname'
]
]
]
];
return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
};
# In any case we need to specify LDAP domain configs
$LDAPProviderDomainConfigs = "$IP/../ldapprovider.json";
# Local login is enabled
$wgPluggableAuth_EnableLocalLogin = true;
$LDAPAuthentication2AllowLocalLogin = true;
$wgPluggableAuth_Class = "MediaWiki\\Extension\\LDAPAuthentication2\\PluggableAuth";
$wgPluggableAuth_ButtonLabel = "Log In (PluggableAuth)";
$wgPluggableAuth_Config['Log In (auth1.acmecorp.com)'] = [
'plugin' => 'LDAPAuthentication2',
'data' => [
'domain' => 'acmecorp.com'
]
];
# LDAP
wfLoadExtension( 'PluggableAuth' );
$wgPluggableAuth_EnableAutoLogin = false; #if true, disables the logout option
$wgPluggableAuth_EnableLocalLogin = true;
wfLoadExtension( 'LDAPProvider' );
$LDAPProviderDomainConfigs = "$IP/ldapprovider.json";
wfLoadExtension( 'LDAPAuthentication2' );
$LDAPAuthentication2AllowLocalLogin = true;
### EDIT EDIT ENABLE DEBUG LOGS
/**
* The debug log file must never be publicly accessible because it
* contains private data. But ensure that the directory is writeable by the
* PHP script running within your Web server.
* The filename is with the database name of the wiki.
*/
$wgDebugLogFile = "/var/log/mediawiki/debug-{$wgDBname}.log";
### ALSO turn on LDAP debug
$wgLDAPDebug = 99;
$wgDebugLogGroups['ldap'] = '/var/log/mediawiki/debug-ldap.log';
$wgShowExceptionDetails = true;
#$wgRevokePermissions['user']['createaccount'] = true;
# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
## Forces user to login to view Wiki
## # The following permissions were set based on your choice in the installer
## $wgGroupPermissions['*']['createaccount'] = false;
## $wgGroupPermissions['*']['edit'] = false;
## $wgGroupPermissions['*']['read'] = false;
I have also tried using ldapprovider.json and that doesn't help either?
{
"LDAP": {
"connection": {
"server": "auth.acme.com",
"user": "cn=readonlyroot,dc=acme,dc=corp",
"pass": "PASSWD",
"port": 636,
"enctype": "tls",
"options": {
"LDAP_OPT_DEREF": 1
},
"basedn": "dc=acme,dc=corp",
"userbasedn": "ou=people,dc=acme,dc=corp",
"groupbasedn": "ou=group,dc=acme,dc=corp",
"searchattribute": "uid",
"searchstring": "uid=USER-NAME,ou=people,dc=acme,dc=corp",
"usernameattribute": "uid",
"realnameattribute": "cn",
"emailattribute": "mail"
},
"userinfo": {
"attributes-map": {
"email": "mail",
"realname": "cn",
"nickname": "uid"
}
}
}
}
[...] The strange thing is that the error is different if I clear my cookie cash. [...]
What exactly is the error?
Please, enable debug logging and share the (redacted) results.
MediaWiki internal error.
Original exception: [Zxt-iIUMHHwirGji-KznVQAAAMA] /wiki/index.php?title=Special:UserLogin&returnto=Development+Info+Wiki TypeError: Cannot assign null to property MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider::$remoteToken of type string
Backtrace:
from /var/www/html/mediawiki-1.42.3/extensions/Auth_remoteuser/src/UserNameSessionProvider.php(793)
#0 /var/www/html/mediawiki-1.42.3/includes/session/SessionBackend.php(756): MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider->persistSession()
#1 /var/www/html/mediawiki-1.42.3/includes/session/SessionBackend.php(670): MediaWiki\Session\SessionBackend->save()
#2 /var/www/html/mediawiki-1.42.3/includes/session/SessionBackend.php(346): MediaWiki\Session\SessionBackend->autosave()
#3 /var/www/html/mediawiki-1.42.3/includes/session/Session.php(133): MediaWiki\Session\SessionBackend->persist()
#4 /var/www/html/mediawiki-1.42.3/includes/specialpage/LoginSignupSpecialPage.php(249): MediaWiki\Session\Session->persist()
#5 /var/www/html/mediawiki-1.42.3/includes/specialpage/SpecialPage.php(719): MediaWiki\SpecialPage\LoginSignupSpecialPage->execute()
#6 /var/www/html/mediawiki-1.42.3/includes/specialpage/SpecialPageFactory.php(1669): MediaWiki\SpecialPage\SpecialPage->run()
#7 /var/www/html/mediawiki-1.42.3/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#8 /var/www/html/mediawiki-1.42.3/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#9 /var/www/html/mediawiki-1.42.3/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#10 /var/www/html/mediawiki-1.42.3/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#11 {main}
Exception caught inside exception handler: [Zxt-iIUMHHwirGji-KznVQAAAMA] /wiki/index.php?title=Special:UserLogin&returnto=Development+Info+Wiki TypeError: Cannot assign null to property MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider::$remoteToken of type string
Backtrace:
from /var/www/html/mediawiki-1.42.3/extensions/Auth_remoteuser/src/UserNameSessionProvider.php(793)
#0 /var/www/html/mediawiki-1.42.3/includes/session/SessionBackend.php(756): MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider->persistSession()
#1 /var/www/html/mediawiki-1.42.3/includes/session/SessionBackend.php(659): MediaWiki\Session\SessionBackend->save()
#2 [internal function]: MediaWiki\Session\SessionBackend->MediaWiki\Session\{closure}()
#3 /var/www/html/mediawiki-1.42.3/vendor/wikimedia/scoped-callback/src/ScopedCallback.php(102): call_user_func_array()
#4 /var/www/html/mediawiki-1.42.3/vendor/wikimedia/scoped-callback/src/ScopedCallback.php(58): Wikimedia\ScopedCallback->__destruct()
#5 /var/www/html/mediawiki-1.42.3/includes/session/SessionManager.php(951): Wikimedia\ScopedCallback::consume()
#6 /var/www/html/mediawiki-1.42.3/includes/session/SessionManager.php(268): MediaWiki\Session\SessionManager->getSessionFromInfo()
#7 /var/www/html/mediawiki-1.42.3/includes/Request/WebRequest.php(864): MediaWiki\Session\SessionManager->getSessionById()
#8 /var/www/html/mediawiki-1.42.3/includes/skins/Skin.php(1721): MediaWiki\Request\WebRequest->getSession()
#9 /var/www/html/mediawiki-1.42.3/includes/skins/Skin.php(1730): Skin->hideNewTalkMessagesForCurrentSession()
#10 /var/www/html/mediawiki-1.42.3/includes/skins/SkinMustache.php(137): Skin->getNewtalks()
#11 /var/www/html/mediawiki-1.42.3/skins/Vector/includes/SkinVectorLegacy.php(161): SkinMustache->getTemplateData()
#12 /var/www/html/mediawiki-1.42.3/includes/skins/SkinMustache.php(92): MediaWiki\Skins\Vector\SkinVectorLegacy->getTemplateData()
#13 /var/www/html/mediawiki-1.42.3/includes/skins/SkinTemplate.php(176): SkinMustache->generateHTML()
#14 /var/www/html/mediawiki-1.42.3/includes/Output/OutputPage.php(3004): SkinTemplate->outputPage()
#15 /var/www/html/mediawiki-1.42.3/includes/exception/MWExceptionRenderer.php(189): MediaWiki\Output\OutputPage->output()
#16 /var/www/html/mediawiki-1.42.3/includes/exception/MWExceptionRenderer.php(106): MWExceptionRenderer::reportHTML()
#17 /var/www/html/mediawiki-1.42.3/includes/exception/MWExceptionHandler.php(133): MWExceptionRenderer::output()
#18 /var/www/html/mediawiki-1.42.3/includes/exception/MWExceptionHandler.php(237): MWExceptionHandler::report()
#19 /var/www/html/mediawiki-1.42.3/includes/MediaWikiEntryPoint.php(221): MWExceptionHandler::handleException()
#20 /var/www/html/mediawiki-1.42.3/includes/actions/ActionEntryPoint.php(82): MediaWiki\MediaWikiEntryPoint->handleTopLevelError()
#21 /var/www/html/mediawiki-1.42.3/includes/MediaWikiEntryPoint.php(205): MediaWiki\Actions\ActionEntryPoint->handleTopLevelError()
#22 /var/www/html/mediawiki-1.42.3/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#23 {main}
I enabled debugging as follows but couldn't see anything LDAP related.
$wgDebugLogFile = "/var/log/mediawiki/debug-{$wgDBname}.log";
### ALSO turn on LDAP debug
$wgLDAPDebug = 99;
$wgDebugLogGroups['ldap'] = '/var/log/mediawiki/debug-ldap.log';
$wgShowExceptionDetails = true;
Stupid question: Which directory should this be in? /var/www/html/mediawiki-1.42.3 or /var/www/html ?
$LDAPProviderDomainConfigs = "$IP/../ldapprovider.json";
You are using Extension:Auth_remoteuser. Can you confirm you have set up the webserver in a way it provides a $_SERVER['REMOTE_USER']
? Something like Kerberos authentication?
I have not done any browser configuration other than to create the ssl.conf and to install the SSL certs as I cannot find any instructions for this, so any advice would be gratefully received .
I built this server from scratch and imported the database from a very old server that runs Centos-7 and has never been updated. It is using the original LDAPAUTH plugin and I can only see the changes that were made to LocalSettings.php. Is there somewhere else I should look?
Both servers are authenticating to an OpenLDAP server.
The old Extension:LDAP_Authentication supported implicit authentication via . But it did not require it. I can not tell if it was used in your old set up (maybe you can share a redacted version of your old configuration here). If not, you don't need Extension:Auth_remoteuser. If it was, you need to configure your webserver in a way it performs the Kerberos authentication and hands over the authenticated username to the wiki application (usually this is done in the [$_SERVER['REMOTE_USER']
] variable). It highly depends on your webserver (Apache, Nginx, IIS) how this needs to be done.
I cannot find any mention of Extension:Auth_remoteuser in the config.
Hi,
The old v1.34.2 server used:
$wgAuth = new LdapAuthenticationPlugin(); $wgAuthManagerAutoConfig['primaryauth'] += [
LdapPrimaryAuthenticationProvider::class => [ 'class' => LdapPrimaryAuthenticationProvider::class, 'args' => [[ 'authoritative' => true, // don't allow local non-LDAP accounts ]], 'sort' => 50, // must be smaller than local pw provider ],
];
$wgLDAPDomainNames = array("ACMELDAP"); $wgLDAPServerNames = array("ACMELDAP"=>"auth.ACMEcorp.com");
$wgLDAPServerNames = array("ACMELDAP"=>"ldapserver.ACMEcorp.com");
$wgLDAPUseLocal = false;
$wgLDAPEncryptionType = array("ACMELDAP"=>"ssl"); $wgLDAPEncryptionType = array("ACMELDAP"=>"tls", "ACMELDAP"=>"ssl", "ACMELDAP"=>"clear", );
$wgLDAPEncryptionType = array("ACMELDAP"=>"ssl"); $wgLDAPOptions = array("ACMELDAP" => array( LDAP_OPT_DEREF, 1 )); $wgLDAPPort = array("ACMELDAP"=>636);
$wgLDAPSearchStrings = array("testLDAPdomain"=>"uid=USER-NAME,ou=people,dc=ACME,dc=corp");
$wgLDAPSearchStrings = array("ACMELDAP"=>"uid=USER-NAME,ou=people,dc=ACME,dc=corp"); $wgLDAPSearchAttributes = array("ACMELDAP"=>"uid"); $wgLDAPBaseDNs = array("ACMELDAP"=>"dc=ACME,dc=corp"); $wgLDAPGroupBaseDNs = array("ACMELDAP"=>"ou=group,dc=ACME,dc=corp"); $wgLDAPUserBaseDNs = array("ACMELDAP"=>"ou=people,dc=ACME,dc=corp"); $wgLDAPProxyAgent = array("ACMELDAP" => "cn=readonlyroot,dc=ACME,dc=corp"); $wgLDAPProxyAgentPassword = array("ACMELDAP" => "PASSWD"); $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['*']['autocreateaccount'] = true;
I have double-checked and I have enabled the extra plugin:
#######################
# LDAP Extensions
######################
wfLoadExtensions( [
'PluggableAuth',
'Auth_remoteuser',
'LDAPProvider',
'LDAPAuthentication2',
'LDAPAuthorization',
'LDAPUserInfo'
] );
$LDAPAuthorizationAutoAuthRemoteUserStringParser = 'username-at-domain';
$LDAPAuthentication2UsernameNormalizer = 'strtolower';
$LDAPAuthentication2AllowLocalLogin = true;
$wgAuthRemoteuserAllowUserSwitch = true;
$wgPluggableAuth_EnableLocalLogin = true;
# $wgLDAPProxyAgent = array("LDAP" => "cn=readonlyroot,dc=acme,dc=corp");
$wgLDAPProxyAgentPassword = array("LDAP" => "PASSWD");
# In any case we need to specify LDAP domain configs
$LDAPProviderDomainConfigs = "/var/www/html/mediawiki-1.42.3/ldapprovider.json";
#$LDAPProviderDomainConfigs = "$IP/../ldapprovider.json";
## Prevent users from adding accounts
#$wgRevokePermissions['user']['createaccount'] = true;
## Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
## Forces user to login to view Wiki
## # The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['autocreateaccount'] = true;
I have tested this but still it doesn't work and I see no LDAP messages in the logs. Do I have to configure Apache in some way?
He querido actualizar mi wiki de la versión 1.34.0 a la versión 1.42.1 y para hacerlo hice una actualización intermedia a la versión 1.39.8 como se recomienda en el manual de actualización. Al hacerlo encuentro que las páginas cuyo nombre contiene tildes, diéresis, ñ o caracteres similares aparecen vacías o sus links de entrada no aparecen en las listas.
Esta es la dirección de mi Wiki:
http://wiki.neotropicos.org/index.php?title=Portada
El problema se puede visualizar en la columna de la izquierda en los links Bibliografía y Topónimos que contienen tildes y dentro del Glosario los vínculos que presentan este problema no aparecen. Sólo aparece la viñeta. Cómo puedo solucionarlo?
____________________________
I wanted to update my wiki from version 1.34.0 to version 1.42.1 and to do so I did an intermediate update to version 1.39.8 as recommended in the update manual. When I did so I found that pages whose names contain accents, umlauts, ñ or similar characters appear empty or their entry links do not appear in the lists.
This is the address of my Wiki:
http://wiki.neotropicos.org/index.php?title=Homepage
The problem can be seen in the left column in the Bibliography and Toponyms links that contain accents and within the Glossary the links that present this problem do not appear. Only the bullet appears. How can I solve it?
Cannot reproduce. All accents appear in "Topónimos" and "Bibliografía". Using Firefox 131 on Linux. Do you have broken fonts installed on your system, maybe?
I have an older script "Werbung.php" which was intecrated per
require_once( "$IP/extensions/Werbung/Werbung.php" );
$wgHooks['ParserBeforeStrip'][]='Werbung';
in the LocalSettings.php and now don't work under version 1.42.
Unfortunately I can't find any hint in error.log of PHP for the problem. What's the best way to fix this update-problem?
Thanks in advance.
It is probably no longer compatible. You would have to ask the author of Werbung.php to release a newer version, or update the code yourse to be conpatible with newer versions of Mediawiki.
Thank your for this information. The author is not available. Perhaps someone has a hint as to what should be adapted here (ins the (in the manageable code):
function getPOIs($cmd) { require_once("/usr/www/users/data.php"); $mysqli = new mysqli($DBHost, $DBUser, $DBPass, $DBName); #Aufbau des Kommandos:<!-- Karte;latitude;longitude;zoom;NumberOfPOIs --> $c = preg_split('/;/', $cmd[0]); $latitude = $c[1]; $longitude = $c[2]; $zoom = $c[3]; $c4 = intval($c[4]); #30.5.15 Anzahl der POIs begrenzen $maxNumberOfPOIs = $c4; if ($c4 == 0) $maxNumberOfPOIs = 50; # POI Anzahl if ($c4 > 1500) $maxNumberOfPOIs = 1500; $map = "{{#display_map: "; $query = "select src from vaPOIs2 order by sqrt( power(lat-$latitude,2) + power(lon-$longitude,2) ) limit $maxNumberOfPOIs"; $result = $mysqli->query($query); while($row = $result->fetch_row()) { $map .= $row[0] . "\n"; } $map = trim ($map); $map = trim ($map, ';'); $map .= "|service=openlayers|center=$latitude, $longitude|width=100%|zoom=$zoom}}"; return $map; } #funct getPOIs function Werbung(&$parser, &$text) { $text = preg_replace_callback ('/<!-- Karte.* -->/', "getPOIs", $text); echo $text; return(true); }
This code looks very simple. Apparently it just composes an invocation of Extension:Maps, based on some database content. But I don't think we can discuss it here on the SupportDesk.
Maybe you want to check out the Professional_development_and_consulting page.
Thanks for the tip. My idea with the board here was just to get an approach to solving the problem. I thought that some people would have to fix similar problems with an update...
You will need to update the "Werbung" extension. There is a guide available that may help you: Manual:Extension_registration/Migration
I had already tried a few things - unfortunately always without success:
1. with Manual:Hooks/de to replace $wgHooks['ParserBeforeStrip'][]='Werbung';
-> Werbung ( $parser, $text );
2. Manual:Hooks/ParserBeforeInternalParse extensions.json -> add:
"HookHandlers": {
"main": {
"class": "MediaWiki\\Extension\\Werbung",
}
},
"Hooks": {
"ParserBeforeStrip": "Werbung",
"services": [ "UserNameUtils" ]
}
alternativ:
"Hooks": {
"ParserBeforeStrip": "MediaWiki\\Extension\\Werbung\\Hooks::onParserBeforeStrip"
},
(at least there was no error message with this version)
But I probably just don't have the right approach ?
The error probably went away because your changes made it fail before the error was encountered.
You should probably post any error message you got.
I have found the error messages of the function
function Werbung(&$parser, &$text) {
$text = preg_replace_callback ('//', "getPOIs", $text);
#echo $text;
#echo "<br><brblblb lblbllbd lbalbab.<br><br>";
return(true);
}
which I set in the LocalSettings.php
Werbung ( $parser, $text );
(instead of the old Hook #$wgHooks['ParserBeforeStrip'][]='Werbung';)
Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /usr/www/users/abc/archiv24/extensions/Werbung/Werbung.php on line 49
Notice: Headers already sent, should send headers earlier than require [Called from MediaWiki\Request\HeaderCallback::warnIfHeadersSent in /usr/www/users/veikkoc/archiv24/includes/Request/HeaderCallback.php at line 94] in /usr/www/users/abc/archiv24/includes/debug/MWDebug.php on line 492
Warning: session_name(): Session name cannot be changed after headers have already been sent in /usr/www/users/abc/archiv24/includes/Setup.php on line 472
You can not call something like Werbung ( $parser, $text );
within LocalSettings.php
. There is neither a $parser
nor a $text
in this context. You need to register the method as a hook handler.
The messages are (more or less) unrelated. I guess you have an empty line somewhere before a <?php
or after a ?>
.
I used the info in Manual:Hooks and changed, like
Function, no data | $wgHooks['EventName'][] = 'efSomeFunction'; |
efSomeFunction( $param1, $param2 ); |
#$wgHooks['ParserBeforeStrip'][]='Werbung'; -> Werbung ( $parser, $text );
(old version -> new version 1.42)
But what exactly is missing?
Respectfully, that's just not how this works at all. I would suggest an introduction to php tutorial. (E.g. https://www.javatpoint.com/php-tutorial )
Hello, thanks for your answer. I thought, if I change the script according to the instruction from Manual:Hooks , an uncomplicated adaption is possible. But if not, who could help me with this little scirpt?
I guess, in case you want help from the community, you should consider making the whole code publicly available (e.g. on github.com). Make sure to use a proper open source license. There are no guarantees you will find a volunteer though.
Otherwise, check out Professional development and consulting.
Thanks for the tip.
I posted the complete code and how to call it above. That's all it is.
The script doesn't actually do anything else, like (for example)
Map;52.436758;13.550262;14;300;
with a collection of POIs that the following software (Maps, possibly with SemanticMediawiki ?) needs to insert a map.
This is what the page should look like when it works: https://www.veikkos-archiv.com/index.php?title=Adlershof
Who could help me with this?
PS: or is it also possible to work here completely without this hook?
Hello, I'm trying to install MW and I get the following error:
[ZyIAAQuhVNbgTKjv0nNYfwAAACA] /mw-config/index.php?page=Install Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?
Please see https:/
And yes the error message stops there, right in the middle of a URL.
I'm using:
- A MySQL (v8.0) database, which I can access with phpMyAdmin. The host and username are recognized by the MW installer.
- PHP v8.3
- The latest version of MediaWiki (downloaded a couple of days ago)
- No extension for now. Just trying to install vanilla MediaWiki.
Is there a more complete error in the php error log?
Even after LocalSettings.php has been put inside the mediawiki-1.42.3 directory it still says that it is not found; why?
The problem with this is that you are not in the right directory. Assuming you are on Linux, it should be in "/var/www/html/wiki". The mediawiki-1.42.3 directory is just the downloaded file, not the actual installation.