Topic on Project:Support desk

Fatal error when clicking on notice: OOUI\Exception - Issue with Theme Singleton in MediaWiki

3
Davisvawiz (talkcontribs)

Hello, I am currently facing a fatal error when clicking on a notice in my MediaWiki site, and I am seeking some assistance in resolving it. The specific notice that triggers the error when i click on it is: "You just made a tenth edit. Thank you and keep up the good work."

The error message I receive is as follows:

"Fatal error: OOUI\Exception: OOUI\Theme::singleton was called with no singleton theme set. in /home/[your_directory]/public_html/[your_site_directory]/vendor/oojs/oojs-ui/php/Theme.php:31"

I have attempted to clear the cache and verify the integrity of the Theme.php and Tag.php files mentioned in the error message. However, these steps did not resolve the issue. I suspect that there might be a compatibility problem between the version of OOUI and my MediaWiki installation.

Has anyone else encountered this particular error when interacting with notices in MediaWiki? If so, I would greatly appreciate any insights or solutions you have discovered. Your guidance and suggestions would be immensely helpful in resolving this issue.

my mediawiki site is Netvibe World

Thank you kindly for your assistance!

Best regards,

Davis Wanyonyi

Bawolff (talkcontribs)

Check that all your extensions are correct version for your version of mediawiki

Davisvawiz (talkcontribs)

Thanks i managed to solve this by creating this php file

<?php

use OOUI\Theme;

class CustomTheme extends Theme {

    public function __construct() {

        // Custom theme initialization code

    }

    // Implement any required methods for your custom theme

}

and adding this following code in the localSetting.php

use OOUI\Theme;

// Create a new theme instance

require_once __DIR__ . '/skins/CustomTheme.php';

$theme = new CustomTheme();

// Set the theme as the singleton

Theme::setSingleton($theme);

Reply to "Fatal error when clicking on notice: OOUI\Exception - Issue with Theme Singleton in MediaWiki"