Topic on Project:Support desk

142.157.25.184 (talkcontribs)

I installed HeadScript and see it in extensions. (I downloaded and added the line require_once "$IP/extensions/HeadScript/HeadScript.php";)

When I try to add any script like it is advised in the manual

$wgHeadScriptCode = <<<'START_END_MARKER'

<script></script>
START_END_MARKER;

It immediately kills the whole site. "The page cannot be displayed" occurs everywhere. This doesn't depend on script, whatever I put between <script></script> have the same effect.

Please, advise how to fix that.

Malyacko (talkcontribs)

Please tell us if there is any further information in your webserver's error log why the page cannot be displayed, and which MediaWiki version this is about.

Seb35 (talkcontribs)

There must not be any space before the last START_END_MARKER; Can you check that?

PS: I added bold around this important instruction in Extension:HeadScript#Configuration.

142.157.25.184 (talkcontribs)

Hi

I use 1.31 version.

I checked and there are no spaces around START_END_MARKER; Neither I have any empty lines before. I just copypaste the example from the extension's page and entered my script between <script></script>.

I turned on PHP errors and here is what it gives me:

Undefined variable: type in /home/..../extensions/HeadScript/HeadScript.php on line 3

The error doen't depend on the script I use, it is there for any script.

142.157.25.184 (talkcontribs)
Seb35 (talkcontribs)

(I re-opened the topic for this comment and re-closed it.)

Ok, I’m glad you found the issue.

I’ve put some comment about this extension on Topic:Uovqh7a0hfngkqgk, feel free to answer if you want.