Jump to content

Topic on Extension talk:SemanticComments

SemanticComments Error Message when Running Jobs

5
129.83.31.2 (talkcontribs)

We installed SemanticComments today and it looked good on our internal wiki. However, when we ran the runJobs script, we got an error. We have MediaWiki 1.20.2, Semantic MediaWiki 1.8 installed.

[root@gestalt-dev]# php runJobs.php
FauxRequest::getRequestURL() not implemented
Backtrace:
#0 /usr/share/mediawiki-1.20.2/includes/WebRequest.php(1305): FauxRequest->notImplemented('FauxRequest::ge...')
#1 /usr/share/mediawiki-1.20.2/extensions/SemanticComments/includes/CE_GlobalFunctions.php(96): FauxRequest->getRequestURL()
#2 [internal function]: cefSetupExtension()
#3 /usr/share/mediawiki-1.20.2/includes/Setup.php(551): call_user_func('cefSetupExtensi...')
#4 /usr/share/mediawiki-1.20.2/maintenance/doMaintenance.php(103): require_once('/usr/share/medi...')
#5 /usr/share/mediawiki-1.20.2/maintenance/runJobs.php(122): require_once('/usr/share/medi...')
#6 {main}
80.149.87.126 (talkcontribs)

We currently have the same problem using mw 1.20.2. Quick and dirty workaround:

Replace the include in LocalSettings.php with

if( !defined('DO_MAINTENANCE') )//do not include if running maintenance scripts
{
        include_once("$IP/extensions/SemanticComments/SemanticComments.php");
        enableSemanticComments();
}

This will deactivate the extension for the running of the script and activate it for regular use of the wiki.

Kind regards

80.149.87.126 (talkcontribs)

Update to the workaround: This will corrupt the Article has average rating property (until page is being purged or resaved). Uncool if you use the rating functionality and make changes that let the maintenancescript run over commented pages.

Kind regards

Hypergrove (talkcontribs)

Sorry for the late reply. I did the same workaround when I ran into the problem, so it's nice to hear that fails so it can be fixed correctly. Most extensions don't access the request block. The workaround should be changed to access a global, and it should be applied there at least.

66.189.214.233 (talkcontribs)

Not sure if anyone is still using this, but I've been messing around with it. If you edit extensions/SemanticCOmments/includes/CE_GlobalFunctions.php and change it to look like this it better solves the issue and doesn't mess up the property

       if( !defined('DO_MAINTENANCE') ) {
               $url = $wgRequest->getRequestURL();
               if(  stripos( $url, $spns_text . ":SemanticComments" ) !== false
                    || stripos( $url, $spns_text . "%3ASemanticComments" ) !== false ) {
                       $wgOut->addModules( 'ext.ce.comment.specialpage' );
               } else {
                       $wgOut->addModules( 'ext.ce.comment' );
               }
       }
Reply to "SemanticComments Error Message when Running Jobs"