Page MenuHomePhabricator

Composer doesn't enable GraphViz
Closed, InvalidPublic

Description

MediaWiki 1.30.0 (d0c8f49)
PHP 7.2.1-1+ubuntu17.10.1+deb.sury.org+1 (fpm-fcgi)
MariaDB 10.2.12-MariaDB-10.2.12+maria~artful-log
LuaSandbox 2.0.13-alpha
Lua 5.1.5

composer require mediawiki/graph-viz '*' creates extensions/GraphViz folder yet doesn't enable the GraphViz extension for MediaWiki. It doesn't appear in Special:Version and the graphs remain source code.

wfLoadExtension ('GraphViz'); helps but this is not the way Composer is supposed to work.

Also, if I try to alter GraphViz setting after enabling the extension (e.g. $wgGraphVizSettings->execPath = '/usr/bin/';), PHP issues a warning:

Creating default object from empty value in (path to MediaWiki)/LocalSettings.php on line (line number).

Obviously, the $wgGraphVizSettings object is not instantiated at this point; I presume I should do it in some hook, but it is not documented at the extension's page at mediawiki.org.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 21 2018, 7:30 AM
alex-mashin updated the task description. (Show Details)Jan 21 2018, 7:32 AM

It is possible that the behaviour changed with https://gerrit.wikimedia.org/r/#/c/368245/2

But this way of installing an extension is not supported - T61872#1361864 or see T467

I suggest to change the documentation on mediawiki.org

Samwilson closed this task as Invalid.Nov 14 2018, 1:17 AM
Samwilson added a subscriber: Samwilson.

It looks like the documentation has been updated, and now asks admins to modify LocalSettings.php even when installing with Composer. Closing this.

wfLoadExtension ('GraphViz'); helps but this is not the way Composer is supposed to work.

There are a few extensions that enable themselves when being installed by Composer, but these are the minority and most do not. I would say installing but not enabling is the way it's supposed to work.

Note also that the configuration variables have now changed (docs are updated).