Open main menu

Project:Support desk

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文

How to create / styles.css file?

53
Tofiq Kərimli (talkcontribs)

Hello I'm new. All my work is in order (https://wiki.sheki.site/) . I only have 2 problems; One of these is that I can not create some files. For example, Module: Citation / CS1 / styles.css has no content How do I create this? The document contains errors. Written: "Are you sure you want to save?" Then it is written: Error: Lua error at line 1: unexpected symbol near '/'. What do I have to do? Thanks in advance.

AhmadF.Cheema (talkcontribs)
Tofiq Kərimli (talkcontribs)

Needed for Template:Citation. I can not create sub template for several other templates.

MarkAHershberger (talkcontribs)

Where do you see the Lua error?

Tofiq Kərimli (talkcontribs)

When I click the "Save changes" button, this warning is displayed: "Are you sure you want to save?" Second time this warning is displayed:Error: Lua error at line 1: unexpected symbol near '/'.

MarkAHershberger (talkcontribs)

I assume you're trying to copy something like this page.

A non-existent page in the Modules namespace that ends with .css is identified as a CSS page. The same page without .css is identified as scribunto or lua. On your wiki, both are identified as scribunto.

This is handled by TemplateStyles and integration of TemplateStyles with Scribunto is only available since 1.33.

You can try installing the newer Scribunto and TemplateStyles in your current wiki, but it looks like you really need to upgrade the wiki.

Tofiq Kərimli (talkcontribs)
Tofiq Kərimli (talkcontribs)

About my Wiki:

MediaWiki 1.32.1
PHP 7.0.33 (cgi-fcgi)
MySQL 5.7.26
ICU 4.2.1
Lua 5.1.5

Do you need any further information?

TheDJ (talkcontribs)

Have you installed Extension:TemplateStyles ? a requirement for many modern complex templates copied from English Wikipedia.

MarkAHershberger (talkcontribs)

I just discovered that extension (see my most recent comment above). Could they install just that extension and designate the Module namespace and have it work?

Tofiq Kərimli (talkcontribs)

I downloaded "Scribunto REL1-33". Everything remained the same. I wanted to change the module here:

https://wiki.sheki.site/index.php?title=X%C3%BCsusi:ChangeContentModel/Module:Citation/CS1/s.css . It turned out:

[XShOPbuOMIRDVkC8476ujAAAAAQ] /index.php?title=X%C3%BCsusi:ChangeContentModel/Module:Citation/CS1/s.css Error from line 76 of /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php(131): TemplateStylesContent->sanitize(array)

#1 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(242): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(211): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

#3 /home/ipekchi/public_html/wiki/includes/Revision/RevisionRenderer.php(175): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)

-//-

#23 /home/ipekchi/public_html/wiki/index.php(42): MediaWiki->run()

#24 {main}


I downloaded "TemplateStyles REL1-33". When I try to create Module:Citation/CS1/styles.css , it emerges: [XShLfpbzS52E3RAPefNzSgAAAAA] /index.php?title=Module:Citation/CS1/styles.css&action=submit Error from line 78 of /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php(135): TemplateStylesContent->sanitize(array)

#1 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(242): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(211): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

-//-

#23 /home/ipekchi/public_html/wiki/index.php(42): MediaWiki->run()

#24 {main}

AhmadF.Cheema (talkcontribs)

I don't think you can install "Scribunto REL1-33" with MediaWiki v1.32 release. You'll have to upgrade your MediaWiki to v1.33 to make use of Scribunto REL1_33.

Tofiq Kərimli (talkcontribs)
MarkAHershberger (talkcontribs)

You will need TemplateStyles in addition to the newer Scribunto.

If you just want to upgrade, you can get the update on the download page.

Tofiq Kərimli (talkcontribs)
MarkAHershberger (talkcontribs)

I see. Then you should just upgrade to the latest version of MediaWiki.

Tofiq Kərimli (talkcontribs)

I did that:

MediaWiki 1.33.0
PHP 7.0.33 (cgi-fcgi)
MySQL 5.7.26
ICU 4.2.1
Lua 5.1.5

Nothing has changed. Everything remains the same. Additionally, the following errors appear on all pages: [XSjUIF7nhIiVEDQYFJvOCAAAAAo] /index.php?title=Ana_S%C9%99hif%C9%99&action=edit Error from line 36 of /home/ipekchi/public_html/wiki/extensions/WikiEditor/includes/WikiEditorHooks.php: Call to undefined method EventLogging::sessionInSample()

Backtrace:

#0 /home/ipekchi/public_html/wiki/extensions/WikiEditor/includes/WikiEditorHooks.php(114): WikiEditorHooks::doEventLogging(string, Article, array)

#1 /home/ipekchi/public_html/wiki/includes/Hooks.php(174): WikiEditorHooks::editPageShowEditFormInitial(EditPage, OutputPage)

#2 /home/ipekchi/public_html/wiki/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)

#3 /home/ipekchi/public_html/wiki/includes/EditPage.php(2770): Hooks::run(string, array)

#4 /home/ipekchi/public_html/wiki/includes/EditPage.php(712): EditPage->showEditForm()

#5 /home/ipekchi/public_html/wiki/includes/actions/EditAction.php(60): EditPage->edit()

#6 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(499): EditAction->show()

#7 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)

#8 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(865): MediaWiki->performRequest()

#9 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(515): MediaWiki->main()

#10 /home/ipekchi/public_html/wiki/index.php(42): MediaWiki->run()

#11 {main}

MarkAHershberger (talkcontribs)

When you upgrade your wiki, you generally need to upgrade all the extensions, as well. Try upgrading WikiEditor and the EventLogging extension.

Tofiq Kərimli (talkcontribs)

Other errors have been corrected. Only "Home Page" is completely lost.

The Module: Citation / CS1 / styles.css has not been created yet. It shows this error:

[XSkAusGSMffooJ-SDnAP@gAAAAM] /index.php?title=X%C3%BCsusi:ChangeContentModel/ Error from line 78 of /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /home/ipekchi/public_html/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php(135): TemplateStylesContent->sanitize(array)

#1 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(265): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /home/ipekchi/public_html/wiki/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

#3 /home/ipekchi/public_html/wiki/includes/Revision/RevisionRenderer.php(193): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)

#4 /home/ipekchi/public_html/wiki/includes/Revision/RevisionRenderer.php(142): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)

-//-

#21 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(865): MediaWiki->performRequest()

#22 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(515): MediaWiki->main()

#23 /home/ipekchi/public_html/wiki/index.php(42): MediaWiki->run()

#24 {main}

MarkAHershberger (talkcontribs)
Tofiq Kərimli (talkcontribs)
MarkAHershberger (talkcontribs)

I don't think you should use the Special:ChangeContentModel page to change the content type. Just let Scribunto and TemplateStyles do their thing. Can you revert your changes?

Tofiq Kərimli (talkcontribs)

Unfortunately, I do not know how to get back. But it seems to me that it's the same as before. Both pages have been deleted.

Tofiq Kərimli (talkcontribs)

I've updated all the extensions. But "Module: Citation / CS1 / styles.css" did not appear. Moreover, "MediaWiki 1.33" works very slowly. does not open "commons.wikimedia" files.

MarkAHershberger (talkcontribs)

Could you re-install with 1.33 so we can see what info on Module:Citation/CS1/styles.css shows?

I'm not sure what you mean by 'does not open "commons.wikimedia" files' but that sounds like a bug that we should find more information about.

Tofiq Kərimli (talkcontribs)

True, the problem of "commons.wikimedia" files probably appeared for another reason. Because I have resumed the MediaWiki version 1.33, the problem remains: https://wiki.sheki.site/index.php?title=X%C3%BCsusi:WantedFiles I do not know why, maybe some extensions have changed. For example, because I downloaded "Scribunto REL1_33" instead of "Scribunto REL1_32". I think that if I return them to the previous situation, it will probably be the same as before.

MarkAHershberger (talkcontribs)

It shows that you still have 1.32 extensions installed instead of 1.33 ones. Let me know when/if you get that straightened out.

Tofiq Kərimli (talkcontribs)

I understand that nobody knows how to solve the problem. Therefore, there is no answer to my question.

Tofiq Kərimli (talkcontribs)
Tofiq Kərimli (talkcontribs)

I resumed version 1-32.1 with "http://wiki.sheki.site/mw-config/". Expansions remain in the "1-33" version. There is no problem. Now there is no problem with "commons.wikimedia".

Tofiq Kərimli (talkcontribs)

I downloaded "MediaWiki 1.33.0" again.

Məhsul Versiya
MediaWiki 1.33.0
PHP 7.0.33 (cgi-fcgi)
MySQL 5.7.26
ICU 4.2.1
Lua 5.1.5

All the extensions were originally "1.33". I wrote this above. No pages can be edited. When I wanted to edit the pages, but the following errors appeared on all pages:


[XSrnNnnkxR@u@UeB5zGZgQAAAAU] /index.php?title=Dinar&action=edit Error from line 36 of /home/ipekchi/public_html/wiki/extensions/WikiEditor/includes/WikiEditorHooks.php: Call to undefined method EventLogging::sessionInSample()

Backtrace:

#0 /home/ipekchi/public_html/wiki/extensions/WikiEditor/includes/WikiEditorHooks.php(114): WikiEditorHooks::doEventLogging(string, Article, array)

#1 /home/ipekchi/public_html/wiki/includes/Hooks.php(174): WikiEditorHooks::editPageShowEditFormInitial(EditPage, OutputPage)

#2 /home/ipekchi/public_html/wiki/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)

#3 /home/ipekchi/public_html/wiki/includes/EditPage.php(2770): Hooks::run(string, array)

#4 /home/ipekchi/public_html/wiki/includes/EditPage.php(712): EditPage->showEditForm()

#5 /home/ipekchi/public_html/wiki/includes/actions/EditAction.php(60): EditPage->edit()

#6 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(499): EditAction->show()

#7 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)

#8 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(865): MediaWiki->performRequest()

#9 /home/ipekchi/public_html/wiki/includes/MediaWiki.php(515): MediaWiki->main()

#10 /home/ipekchi/public_html/wiki/index.php(42): MediaWiki->run()

#11 {main}


Does not open "commons.wikimedia" files. Should we go back or solve this problem?

AhmadF.Cheema (talkcontribs)

Usually, your MediaWiki core and extensions have to be correspond to the same release.

Take a look at the error description. It mentions "extensions/WikiEditor" and a call to an undefined method. This usually means that the release versions of your WikiEditor extension and MediaWiki core do not match.

Make sure your Extension:WikiEditor is the right version.

Tofiq Kərimli (talkcontribs)
Tofiq Kərimli (talkcontribs)

Now I'll check it again. I'm paying attention to the fact that when the name "EventLogging" is removed from the "LocalSettings.php" page, the errors disappear.

Tofiq Kərimli (talkcontribs)
This post was hidden by 94rain (history)
AhmadF.Cheema (talkcontribs)
Tofiq Kərimli (talkcontribs)

No, I checked them all, and sometimes I downloaded it several times. I uploaded a new one here ( расширение: EventLogging, - mediawiki-extensions-EventLogging-REL1_33 ) . Look, the history of both of them is the same.

AhmadF.Cheema (talkcontribs)
Tofiq Kərimli (talkcontribs)
Tofiq Kərimli (talkcontribs)
Tofiq Kərimli (talkcontribs)

I've created a new Wiki.

Məhsul Versiya
MediaWiki 1.33.0
PHP 7.0.33 (cgi-fcgi)
MySQL 5.7.26
ICU 4.2.1
Lua 5.1.5


Extensions are those contained in it. I have just downloaded "Scribunto-REL1_33" and TemplateStyles-REL1_33. But it is not possible to create "Module: Citation / CS1 / styles.css". Here Anomie pointed out the solution to the problem: "You probably forgot to run composer update --no-dev as described at Extension:TemplateStyles#Installation?" But the "composer update" file does not exist here and I do not know what to do? AhmadF.Cheema and MarkAHershberger, I would be very happy if you told me that.

MarkAHershberger (talkcontribs)

Re: composer. There is no "composer update" file. That would be a command you run.

Do you have shell access? If not, fulfilling the dependencies is going to be a problem.

AhmadF.Cheema (talkcontribs)
Tofiq Kərimli (talkcontribs)

No, I think there is no difference. These files (Scribunto: .eslintrc.json; .gitignore; .minus-x.json; .gitreview; .phpcs.xml; .stylelintrc.json and TemplateStyles: .eslintrc.json; .gitignore; .gitreview; .phpcs.xml ) do not appear there, but appear in "ftp"... The cause of the problem is known. Here Anomie pointed out the solution to the problem: "You probably forgot to run composer update --no-dev as described at Extension:TemplateStyles#Installation?" But the "composer update" file does not exist here and I do not know what to do? I would be very happy if you told me that.

Tofiq Kərimli (talkcontribs)

When I try to create a "Module: Citation / CS1 / styles.css, the following error appears:"


[XS4dotTx@UPJx-C1o@Y-CAAAAA4] /index.php?title=Module:Citation/CS1/styles.css&action=submit Error from line 78 of /home/ipekchi/public_html/sheki.site/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /home/ipekchi/public_html/sheki.site/extensions/TemplateStyles/includes/TemplateStylesContent.php(135): TemplateStylesContent->sanitize(array)

#1 /home/ipekchi/public_html/sheki.site/includes/Revision/RenderedRevision.php(265): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /home/ipekchi/public_html/sheki.site/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

--//--

#26 /home/ipekchi/public_html/sheki.site/index.php(42): MediaWiki->run()

#27 {main}

MarkAHershberger (talkcontribs)

We're getting somewhere. At least the right content handler is being used.

Tofiq Kərimli (talkcontribs)

Within a month, I expect someone to answer my question. But no one answers. But I hope that the answer will be soon. I look forward to this minute.

MarkAHershberger (talkcontribs)

Calm down.

It hasn't even been a day, let alone a month. Those of us who post here do so in our free time. Sometimes other things in life have our attention so we are not able to respond quickly.

Reply to "How to create / styles.css file?"
Loman87 (talkcontribs)

Yes, just pdf! Anyway, I get this error when trying to upload


[35107bde4eb37ec0d2143a4c] /mediawiki/index.php/Special:Upload MWException from line 496 of /var/lib/mediawiki/includes/filerepo/file/LocalFile.php: Could not find data for image 'file.pdf'.

Backtrace:

#0 /var/lib/mediawiki/includes/filerepo/file/LocalFile.php(654): LocalFile->loadExtraFromDB()

#1 /var/lib/mediawiki/includes/filerepo/file/LocalFile.php(919): LocalFile->load(integer)

#2 /var/lib/mediawiki/extensions/PdfHandler/includes/CreatePdfThumbnailsJob.php(112): LocalFile->getMetadata()

#3 /var/lib/mediawiki/includes/Hooks.php(177): CreatePdfThumbnailsJob::insertJobs(UploadFromFile, string, boolean)

#4 /var/lib/mediawiki/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#5 /var/lib/mediawiki/includes/upload/UploadBase.php(481): Hooks::run(string, array)

#6 /var/lib/mediawiki/includes/upload/UploadBase.php(347): UploadBase->verifyFile()

#7 /var/lib/mediawiki/includes/upload/UploadFromFile.php(95): UploadBase->verifyUpload()

#8 /var/lib/mediawiki/includes/specials/SpecialUpload.php(503): UploadFromFile->verifyUpload()

#9 /var/lib/mediawiki/includes/specials/SpecialUpload.php(207): SpecialUpload->processUpload()

#10 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialUpload->execute(NULL)

#11 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#12 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#13 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#14 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#15 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#16 {main}


With other file extensions there is no problem. I check other similar issues but mine seems to be different (images directory permissions are 777; I don't run SELinux; pdf is an allowed file extension).

My version is

Product Version
MediaWiki 1.31.1
PHP 7.0.32-0ubuntu0.16.04.1 (apache2handler)
MySQL 5.7.24-0ubuntu0.16.04.1
ICU 55.1
Elasticsearch 5.6.1
Lua 5.1.5

Thanks for any help!

Lorenzo

Malyacko (talkcontribs)

What is the MIME type of 'file.pdf'? Command would be: file --mime-type -b file.pdf

Loman87 (talkcontribs)

Hi,

thanks for your answer. The MIME type is application/pdf. I have tried with different pdf but it doesn't work.

Loman87 (talkcontribs)
Bttfvgo (talkcontribs)

Any help? Ever since upgrading to MW 1.33 I have been experiencing the exact same error! I can't upload any new PDF files! At least time I got thumbnails working (couldn't get working for anything on 1.32...) but I have many PDF files I need to upload. Do you think importImages.php might do the trick?

Bttfvgo (talkcontribs)

Well I tried it and surprisingly enough, I was actually able to upload new PDFs. Or at least 3 out of the 4 I tried. The last three went through fine but the first one failed (even though the image was placed in the proper directory, it says it doesn't exist.) I can't reupload a copy because I get the same "Could not find data..." error. But this was also the file that failed the last time. So I'm not sure whether importImages worked, or whether those were files that the system might have accepted via upload without shooting out errors anyway. I guess I'll have to find more files I want to upload and see if they go through or fail. But I know the image is valid... it comes straight from Commons!

Bttfvgo (talkcontribs)
Bttfvgo (talkcontribs)

And yes I tried the "disable PDF handler, upload the file, and then re-enable it". It refuses to generate thumbnails and contains no metadata. There has to be something going on that I just can't figure out. (I've been getting more errors since I upgraded to 1.33 than I ever did before - no errors in 1.30. I'll figure them out, but SO much has changed between 1.32 and 1.33...)

Loman87 (talkcontribs)

The method "disable PDF handler, upload the file, and then re-enable it" worked for me with 1.31; maybe yours is something different, don't you have any backtrace?

Bttfvgo (talkcontribs)

It provided one almost identical to yours. Strangely enough, the file actually showed up, in all its glory, metadata and all, when I checked the next day. I haven't tried uploading any more PDFs since then, but if I have any problems, I'll certainly let you know!

Reply to "Fail to upload pdf"

Why 1.33 is not displayed as latest stable in Special:ExtensionDistributor?

4
Summary by Lorentz21

Fixed

Lorentz21 (talkcontribs)

In Special:ExtensionDistributor/Echo, you can see 1.32 is selected as 'latest stable MediaWiki' by default while 1.33 is marked as 'next stable candidate'. Is it intended? If not, where and how do I report this? Thanks.

MarkAHershberger (talkcontribs)
Lorentz21 (talkcontribs)
MarkAHershberger (talkcontribs)

Looks good... Thanks!

multiple domains pointing to the same wiki (apache/wiki configuration)

3
Loizbec (talkcontribs)

I have a wiki that is configured for short urls and just as I want it : some pages are readable by the world, the rest is just visible by those who work on the various projects it hosts. Let's say its url is mywiki.myinstitution.net

I ended up creating my webpage on that wiki and I want all the subpages of my user page to have the same domain name, which is different from the main wiki domain name (for instance me.myinstitution.com).

I started by defining rewriting rules with full urls :

<VirtualHost me.myinstitution.com:80>
    ServerName me.myinstitution.com
    RewriteEngine On
    RewriteRule "^/*$" "http://mywiki.myinstitution.net/wk/User:Me"
    RewriteRule "^(/.*)" "http://mywiki.myinstitution.net/wk/User:Me$1"
</VirtualHost>

but apache considers them as redirections, so they don't do exactly what I would like them to. The problem is that when I change them to the type of rewrites that will not be redirections, they obviously conflict with the global configuration of the wiki, and the pages are not even allowed access for anonymous users…

      RewriteRule "^/*$" "/var/www/html/w/index.php/User:Me"

Is there hope to find a solution for my problem ?

NB : the configuration file looks like the following :

<VirtualHost mywiki.myinstitution.net:80>
    ServerName mywiki.myinstitution.net
    ServerAdmin me@myinstitution.net
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/html/w/>
        Options FollowSymLinks        
    </Directory>
    RewriteEngine On
    RewriteRule ^/?wk(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
    # Redirect / to Main Page
    RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
</VirtualHost>

Thanks for any input…

MarkAHershberger (talkcontribs)

Have a look at MEZA, a deployment system put together by some MediaWiki administrators at NASA for managing multiple wikis (with different access needs) for their own use.

Bawolff (talkcontribs)

In LocalSettings.php add some code that looks at what the current path is (via $_SERVER) and uses an if statement to set $wgServer

Its quite a bit more complex if you want to also change the article/script path

Reply to "multiple domains pointing to the same wiki (apache/wiki configuration)"

I can see the header but no content

3
Ibrgk (talkcontribs)

I am using mediawiki a while now. Suddenly I can see the header but no text anymore. When I look in the database in the table .._text, I can see a few rows with blob type, which I can not read.

Can somebody help me with this issue. Any ideas?

Product Version
MediaWiki 1.33.0
PHP 7.2.20 (cgi-fcgi)
MariaDB 10.1.40-MariaDB-cll-lve
AhmadF.Cheema (talkcontribs)

Can you provide a link to your Wiki?

Did you recently did an upgrade?

When you open up the edit link of an article, is the content present in the editor?

Ibrgk (talkcontribs)

I did an upgrade recently.

http://vodiaal.com/mw/index.php?title=Main_Page is the link to the main page. which was filled with other links. When I want to edit an article, like the main page, it shows:

The revision #0 of the page named "Main Page" does not exist.

This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log.

When I look in the deletion log, there is nothing in it.

Reply to "I can see the header but no content"
Summary by Wgkderdicke

The Guestbook extension changes the $wgSpamRegex value! This I have overseen because it is not a typcial spam protecion extension. In addtion to that, the DefaultSetting.php sets $wgSpamRegex to an empty array and the manual here claims true as default value. This gave me some additional confusion.

Wgkderdicke (talkcontribs)

I recently updated this wiki here to V1.31. Now I'm doing this and that to polish up the visual appearance a little bit. Doing so, I discovered an odd behaviour:

Every page that contains the term spam, actually three pages which are dealing with this topic, are rejected by a dubios spam protection filter. This filter claims, that

The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.

and

The following text was found by the spam filter: Spam

And I have to admit: Yes, the term is used on this pages. But to describe something around the topic spam. As far as I know, this is far away from being spam itself.

Subsequently there is really no way to circle around this blocking. Even as Sysop my hands are tied!

So does anybody know a way to stall this edgy spam filter jumping on a harmless four letter word like spam, in particular one will only explain this term.

Many thanks for an answer in advance!

MarkAHershberger (talkcontribs)

This functionality is not built into MediaWiki. Try disabling some extensions or talk to your host?

Wgkderdicke (talkcontribs)

Well, in case of this rejected content the de.json file from the languages/i18n folder provides exactly the shown error messages. There are three messages called spamprotectiontitle, spamprotectiontext and spamprotectionmatch. The content of that messages, in addition with the bad word spam, is displayed instead of saving the article. The en.json file also contains the english pendant of this messages, starting in line 3020 of en.json (MW 1.31.3).

Also this messages are mentioned here: Manual:$wgSpamRegex

But it is not changed in my LocalSettings.php. It comes from DefaultSettigs.php as $wgSpamRegex = [];.

The explanation in above mentioned manual also describes my experience: even a Sysop fails to save if that error occurs.

Wgkderdicke (talkcontribs)

Bingo. I added $wgSpamRegex = false; to my LocalSettings.php. Now the pages which cotains the term spam can be saved again. In contrast to Manual:$wgSpamRegex, which claims that the default value is false, the MW 1.31.3 DefaultSetting.php gives me an empty array instead. Maybe this causes confusion or some weird fallback solution with some odd regex from elsewhere gets suddenly effective.

MarkAHershberger (talkcontribs)
Wgkderdicke (talkcontribs)
MarkAHershberger (talkcontribs)

yes, thanks.

Elastica\Exception\Connection\HttpException from line 187...\Http.php: Couldn't connect to host, Elasticsearch down?

11
Bruceillest (talkcontribs)
Product Version
MediaWiki 1.32.0
PHP 7.2.7 (cgi-fcgi)
MySQL 8.0.15
ICU 61.1
CirrusSearch 0.2 (b1fa4bd)06:47, 20 February 2019 GPL-2.0-or-later
Elastica 1.3.0.0 (9fcf88c)02:09, 11 October 2018 GPL-2.0-or-later

I tried to run the commands in the read me and it just states that elasticsearch is down. I've tried to connect using curl localhost:9200 and all it gives me is "curl: (7) Failed to connect to localhost port 9200: Connection refused". I ran a netstat and didn't see port 9200 I've also rebooted and don't have any firewalls running. Is there a way to start the elasticsearch service with this setup? This is the first time installing CirrusSearch and Elastica.

MarkAHershberger (talkcontribs)

Try sudo systemctl start elasticsearch. If that works--if there is no error and curl is giving you results--then systemctl can be used to enable it so it starts at boot. To do that, try sudo systemctl enable elasticsearch.

Let us know of any problems.

Bruceillest (talkcontribs)

Mark, thanks for your response but I forgot to mention I am running all of this in Windows server 2012R2. There is no elasticsearch service installed in Windows its only the Elastica extension folder. Is there a batch file or php file I have to run to start it?

MarkAHershberger (talkcontribs)

That does make a difference!

You'll need to install ElasticSearch and make sure it is running. MediaWiki will communicate with it to do the searching.

Bruceillest (talkcontribs)

Awesome I'm making progress but now I'm getting this error.

Elastica\Exception\ResponseException from line 179 of C:\inetpub\wwwroot\CAS\extensions\Elastica\vendor\ruflin\elastica\lib\Elastica\Transport\Http.php: Root mapping definition has unsupported parameters:  [mw_cirrus_metastore : {dynamic=false, properties={mediawiki_version={type=keyword}, mapping_min={type=long}, analysis_maj={type=long}, cirrus_commit={type=keyword}, mapping_maj={type=long}, wiki={type=keyword}, shard_count={type=long}, type={type=keyword}, index_name={type=keyword}, mediawiki_commit={type=keyword}, analysis_min={type=long}, namespace_name={norms=false, analyzer=near_match_asciifolding, type=text, index_options=docs}}}] [reason: Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [mw_cirrus_metastore: {dynamic=false, properties={mediawiki_version={type=keyword}, mapping_min={type=long}, analysis_maj={type=long}, cirrus_commit={type=keyword}, mapping_maj={type=long}, wiki={type=keyword}, shard_count={type=long}, type={type=keyword}, index_name={type=keyword}, mediawiki_commit={type=keyword}, analysis_min={type=long}, namespace_name={norms=false, analyzer=near_match_asciifolding, type=text, index_options=docs}}}]]


I installed Elasticsearch v7.2.0 is this issue due to the version I'm using?

MarkAHershberger (talkcontribs)

Yes, you need Elasticsearch 5.5.x or 5.6.x as the CirrusSearch page says.

Bruceillest (talkcontribs)

Yep sorry about that I noticed that late. So I installed elasticsearch and was able to run all the commands apparently well but when I search for a page it won't populate. I added "&action=cirrusDump" on pages that show up and don't show up on search and the ones that show up have text information and the searches that don't show up have no text information. I'm guessing some pages are indexing and others aren't so I ran updateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier=now and forceSearchIndex.php and still no dice. I ended up installing elasticsearch 5.6.0.


Also when I ran forceSearchIndex.php --skipLinks --indexOnSkip and forceSearchIndex.php --skipParse commands I didn't get an output which I was wondering if that's normal.

MarkAHershberger (talkcontribs)

Does it populate your index even though it isn't printing?

Bruceillest (talkcontribs)

How can I tell if it populates my index?


Bruceillest (talkcontribs)

This is the output I get when I run

C:\Windows\system32>curl localhost:9200/_cat/indices?v

health status index                      uuid                    pri rep docs.count docs.deleted store.size pri.store.size

green  open   mw_cirrus_metastore_first  U05k9IpgRTyliejRcCPbcw    1    0          21           18      18.3kb         18.3kb

green  open   caswiki_general_1563218277 fO7-X4mmTAGDn-JY0jleNA   4    0          0            0        648b            648b

green  open   caswiki_content_1563218273 bns-287uS36967cO13eY9g    4    0          9            0    652.2kb        652.2kb

green  open   .tasks                      KX7oUmTUSui9XV5NIfqhlA   1    0          0            0        191b            191b


I have around 244 pages created with a lot of content so I guessing these numbers should be more.

MarkAHershberger (talkcontribs)

I really don't know that much about ElasticSearch. When I said "does it populate your index?" I meant, "can you find pages via searching? If so, your index is probably being populated."

Reply to "Elastica\Exception\Connection\HttpException from line 187...\Http.php: Couldn't connect to host, Elasticsearch down?"

Change Image Rendering Size when Printable=Yes

4
OOZ.MOO (talkcontribs)

I am using the syntax "File: filename.png|728px" to embed Images into my Wiki. I use 728px cause it sits better next to the text in my Wiki. I'm also using Mpdf extension to print out the whole Wiki Page into a pdf. The problem is the syntax creates an extra link of the source image with a compressed version of the Image with the resolution of width="728" height="410". When I take the output with Mpdf, the quality gets super low because of the compressed image that is created.

Question is, is there a way to bypass this Srcset link with the 728px which is created when Printable=Yes and use directly the picture with the original resolution instead?

I am super stuck with this, and I can't find any solution for it. Help is highly appreciated.


MarkAHershberger (talkcontribs)

It sounds like you want the PDF rendering to use a higher resolution than than web rendering, right?

OOZ.MOO (talkcontribs)

Hey Mark, thanks for your feedback. Yes exactly. I want to somehow keep the 728px in the online layout, but when I use the Printable=Yes, skip the srcset link which is created and instead use the src link which is the original size.

MarkAHershberger (talkcontribs)

That sounds like you need to file a task in phabricator and ping @Pastakhov, the maintainer of the extension.

Reply to "Change Image Rendering Size when Printable=Yes"

I am trying to make a new Extension, but getting an error at line '$parser->getOutput()->addModules( 'ext.E.scripts' )';

11
Summary by 103.118.50.4

The code is edited,and it is working now.

103.118.50.4 (talkcontribs)