FriendsOfFlarum / formatting

Customize TextFormatter with plugins through the admin interface
MIT License
22 stars 10 forks source link

When enabling "Mentions" and "Formatting" together, others extensions seems to be disabled #9

Closed Hiobi closed 4 years ago

Hiobi commented 4 years ago

Hi !

Like I reported on flarum/core, there is a mistake between fof/formatting and flarum/mentions.

Bug Report

Current Behavior Hi ! Since I updated to Flarum 0.1.0-beta.12 and upgraded all extensions, when I tried to enabling "Mentions" and "Formatting" together, all others extensions seems to be disabled.

Steps to Reproduce After an upgrade of flarum core and all extensions :

  1. Go to 'Extensions panel'
  2. Click on 'enabling Mention and Formatting'
  3. Go to 'main discussion page'
  4. See error : no others extension enabled (Core extensions and third extensions)

Trying to resolve

Environment



**Screenshots**
Without "Mentions" and Formatting enabled
![](https://forum.nefald.fr/assets/files/2020-03-17/1584470363-210190-withoutmentionsenabled.png)

With "Mentions" and Formatting enabled
![](https://forum.nefald.fr/assets/files/2020-03-17/1584470363-471987-withmentionsenabled.png)

thanks for your reply !

![](https://forum.nefald.fr/assets/files/2020-03-17/1584473889-112073-errormentions.png)
dsevillamartin commented 4 years ago

That seems to be an issue with the content of one of the posts - part which is parsed by the text formatter plugins enabled by this extension. I really can't offer much help because one of your post contents is faulty (incorrect XML), and that's caused by the plugins existing in TextFormatter, which this extension just enables.

clarkwinkelmann commented 4 years ago

Maybe related to the Firefox XSL issue ? But we fixed that before releasing beta 12 didn't we ?

I can't find it we wrote anything about the XSL issue (no issue or PR). Was it fixed in TextFormatter ?

JoshyPHP commented 4 years ago

I don't think the library can generate invalid XML for the post content. It's happened maybe once or twice in 10 years.

The XSL thing is more likely and updating the dependencies should fix it.

Hiobi commented 4 years ago

Hi everyone ! I made some others tests, to reproduce error I need to enabling 4 extensions together, not just flarum-mentions and fof-formatting.

  1. To reproduce it, I need to enabling :

    • fof-formatting
    • flarum-mentions
    • flarum-markdown
    • flarum-emoji
  2. I got the XML error and all extensions seems to be disabled.

  3. If if disable fof-formatting, everything is ok and I didn't have XML error.

Flarum core 0.1.0-beta.12
PHP version: 7.4.3
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gettext, iconv, imagick, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, Zend OPcache
+-------------------+----------------+--------+
| Flarum Extensions |                |        |
+-------------------+----------------+--------+
| ID                | Version        | Commit |
+-------------------+----------------+--------+
| fof-formatting    | 0.1.4          |        |
| flarum-emoji      | v0.1.0-beta.12 |        |
| flarum-mentions   | v0.1.0-beta.12 |        |
| flarum-markdown   | v0.1.0-beta.12 |        |
+-------------------+----------------+--------+
clarkwinkelmann commented 4 years ago

I am unable to replicate on beta 12 with fof/formatting dev-master and Firefox 74

Which options did you enable inside of fof/formatting ?

Can you share the output of composer show s9e/text-formatter -t ?

Could you also try running composer update s9e/text-formatter and try again ? Please share the output of the previous command before and after running update.

When up to date it should show something like:

s9e/text-formatter 2.3.7 Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.
├──ext-dom *
├──ext-filter *
├──lib-pcre >=8.13
├──php >=7.1
└──s9e/regexp-builder ^1.4
   ├──lib-pcre >=7.2
   └──php >=5.5.1

If updating text-formatter doesn't have any effect, then maybe it's specific to an existing post content. You'd need to showhow isolate which post it might be and share its database content with us to take a look. I'm not sure how to do that though.

Hiobi commented 4 years ago

So !

I think I fixed the problem during my tests, enabling and disabling differents options of fof-formatting (is it possible?). No error happened anymore after that.

here the output of composer show s9e/text-formatter -t before updating s9e/text-formatter:

s9e/text-formatter 2.3.7 Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.
├──ext-dom *
├──ext-filter *
├──lib-pcre >=8.13
├──php >=7.1
└──s9e/regexp-builder ^1.4
   ├──lib-pcre >=7.2
   └──php >=5.5.1

And after (was up-to-date):

s9e/text-formatter 2.3.7 Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.
├──ext-dom *
├──ext-filter *
├──lib-pcre >=8.13
├──php >=7.1
└──s9e/regexp-builder ^1.4
   ├──lib-pcre >=7.2
   └──php >=5.5.1
dsevillamartin commented 4 years ago

Is the problem fixed then? Also, looks like you already had TextFormatter updated to the latest version Flarum uses.

Hiobi commented 4 years ago

Hi !

I waited a few days to see if the problem recurred according to the context, I did not have any other errors. It actually had to be resolved in my previous action. Thanks for the support!