Jump to content

Topic on Extension talk:TextExtracts

prop=extracts not working and send back Error 500

5
DAVY2018 (talkcontribs)

As the title mentioned, when I try to use Popups with TextExtract, the Popups often shows "There was issues displayding this preview".

When I check by using Chrome's function to check the code and console, it shows that there is a "500 Internal Server Error".

I have tried using API Sandbox to test every part of the api, and discover that once prop=extracts part was put in the api, it will send back Error Code 500. But when it was removed, no error will be given and the output remains normal.

Is there reason why this situation would happen and is there any possible ways to solve it?

P.S I have set short URL by apache2 according to the Tutorial in Mediawiki, while api.php is accessible and have no problem to access at all.

Thiemo Kreuz (WMDE) (talkcontribs)

Is this question about a self-hosted wiki? An error 500 could be anything. You would need to find the responsible error message in your server's log files. Manual:How to debug might help.

DAVY2018 (talkcontribs)

Yes, the wiki is a self-hosted wiki.

Thank you for your advice and I will try to figure it out by log files.

DAVY2018 (talkcontribs)

After debugging, it shows the following lines:

Fatal error: Declaration of TextExtracts\ExtractFormatter::onHtmlReady(string $html): string must be compatible with HtmlFormatter\HtmlFormatter::onHtmlReady($html) in /var/www/<my wiki name>/w/extensions/TextExtracts/includes/ExtractFormatter.php on line 66

Does this means that the extension php is having error?

DAVY2018 (talkcontribs)

Problem Solved after executing "composer require wikimedia/html-formatter".

Reply to "prop=extracts not working and send back Error 500"