Giter VIP home page Giter VIP logo

Comments (6)

edwardspec avatar edwardspec commented on August 13, 2024 1

See https://phabricator.wikimedia.org/T321234
Closing, as this very same error happens without JsCalendar.

from mediawiki-extension-jscalendar.

edwardspec avatar edwardspec commented on August 13, 2024

Not reproduced locally. Might be caused by one of the pages in the wiki having incorrect UTF-8 on it.

The error mentioned on https://phabricator.miraheze.org/T9688 is happening in MediaWiki parser (not in the JsCalendar code):

preg_match_all error 4: Malformed UTF-8 characters, possibly incorrectly encoded
from /srv/mediawiki/w/includes/MagicWordArray.php(319)
#0 /srv/mediawiki/w/includes/parser/Parser.php(4116): MagicWordArray->matchAndRemove(string)
#1 /srv/mediawiki/w/includes/parser/Parser.php(1636): Parser->handleDoubleUnderscore(string)
#2 /srv/mediawiki/w/includes/parser/Parser.php(882): Parser->internalParse(string, boolean, boolean)
#3 /srv/mediawiki/w/includes/parser/Parser.php(906): Parser->recursiveTagParse(string, boolean)
#4 /srv/mediawiki/w/extensions/JsCalendar/includes/EventCalendar.php(192): Parser->recursiveTagParseFully(string)
...

It's theoretically possible that the page had incorrect UTF-8 on it (JsCalendar passes contents of the page to MediaWiki parser),
but per what I see in the Phabricator, your page only had the word "Test" on it and nothing else (so it can't be incorrect UTF-8).

JsCalendar doesn't do any transformations to the "contents of the page" string before passing it to Parser. It's not truncated, not wrapped, not encoded, etc. JsCalendar takes the page text directly from the database and gives it to Parser.

from mediawiki-extension-jscalendar.

bawolff avatar bawolff commented on August 13, 2024

FWIW, to reiterate what i said on the other bug, I do not believe that this issue is the same as https://phabricator.wikimedia.org/T321234. https://phabricator.wikimedia.org/T321234 is about old non-utf8 valid data that for some reason was not normalized properly. Any page that this is happening on that is less than 15 years old, probably has a different cause (May or may not be this extensions fault, I'm not familiar with this extensions code. Could be some other issue at miraheze)

from mediawiki-extension-jscalendar.

bawolff avatar bawolff commented on August 13, 2024

It may quite possibly be the fault of code at https://github.com/edwardspec/mediawiki-extension-JsCalendar/blob/master/includes/FindEventPagesQuery.php#L188 - this is not processing the old_flags field properly, which could result in the exception described depending on the wikis config (Processing old_flags properly is really hard, I would generally recommend using MW core's various classes to get page text instead if at all possible)

from mediawiki-extension-jscalendar.

edwardspec avatar edwardspec commented on August 13, 2024

this is not processing the old_flags field properly

Thank you.

Turns out, Miraheze had $wgCompressRevisions = true;, that's why it's not working. All revisions are compressed.
https://github.com/miraheze/mw-config/blob/7b230dd2072bb2361b099adba3ba17b9edcdaf33/Database.php

I would generally recommend using MW core's various classes to get page text instead

Will investigate. This seems to be handled in SqlBlobStore::expandBlob(), can also be done via SqlBlobStore::getBlobBatch().

from mediawiki-extension-jscalendar.

edwardspec avatar edwardspec commented on August 13, 2024

Should be working now.

from mediawiki-extension-jscalendar.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.