cms_pico icon indicating copy to clipboard operation
cms_pico copied to clipboard

Call to undefined method ParsedownExtra::textElements()

Open paulcalabro opened this issue 4 years ago • 16 comments

Hi,

I'm getting 500s when trying to access my website (previously this had worked). In my nextcloud.log file, I see the following:

":3,"time":"2019-12-07T18:48:06+00:00","remoteAddr":"<REDACTED>","user":"<REDACTED>","app":"index","method":"GET","url":"\/index.php\/apps\/cms_pico\/pico\/tutorials","message":{"Exception":"Exception","Message":"Call to undefined method ParsedownExtra::textElements()","Code":0,"Trace":[{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args"

Version info:

  • Pico CMS: 1.0.2
  • Nextcloud 17.0.1

The only things that have changed are:

  • Upgrades for Nextcloud
  • Upgrades for Pico CMS and other apps

I suspect it might be related to this recent change:

https://github.com/nextcloud/cms_pico/commit/0429d86ceeb488be3bc7c6dd700381f0439b7d20#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780

paulcalabro avatar Dec 07 '19 18:12 paulcalabro

Please provide the full stacktrace

PhrozenByte avatar Dec 07 '19 20:12 PhrozenByte

Okay, here's the stack trace:

https://gist.github.com/paulcalabro/eedfa66593f46085cde2332864fde556

paulcalabro avatar Dec 07 '19 21:12 paulcalabro

Remove the app and install it again.

PhrozenByte avatar Dec 07 '19 21:12 PhrozenByte

Okay, doing that now.

paulcalabro avatar Dec 07 '19 21:12 paulcalabro

Same error.

paulcalabro avatar Dec 07 '19 21:12 paulcalabro

This is very likely caused by a conflicting other app that also uses Parsedown, but an older version of it. I'm afraid we can't really do anything about that. You must remove the conflicting app (none of the shipped/default ones) to get Pico CMS for Nextcloud working.

PhrozenByte avatar Dec 08 '19 00:12 PhrozenByte

What's a good approach to identifying the conflicting app?

paulcalabro avatar Dec 08 '19 20:12 paulcalabro

Disable custom apps one after another until Pico CMS for Nextcloud works.

PhrozenByte avatar Dec 08 '19 20:12 PhrozenByte

I just experienced the same issue. The offender - Terms Of Service

Bug submitted there: https://github.com/nextcloud/terms_of_service/issues/274

codejp3 avatar Dec 11 '19 06:12 codejp3

Hi @PhrozenByte , nickvergessen here, the author of the ToS app.

We are currently still using the 1.7.3 version. When I checked versions, I saw you are even running a beta version? Not sure I like this too much. Would 1.7 as the latest stable release be okay for you as well, or what particular reason makes you run the beta rather then a stable version?

Edit: checking composer.lock ToS is actually using 1.7.3

nickvergessen avatar Dec 11 '19 07:12 nickvergessen

@nickvergessen: Aidan Woods took over development of Parsedown two years ago (I was kinda into Parsedown's development this time, too). He did an amazing job, like allowing Parsedown to handle untrusted input and improving CommonMark compatibility. However, Parsedown's release process got a bit... confusing.

Aidan is currently working on Parsedown 2.0, basically a rewrite from scratch. He initially planned to improve Parsedown gradually, however, this didn't work out well. Parsedown's code base is pure chaos. You can't really work on it without breaking previous behaviour. However, there were a lot of super annoying bugs (including security issues when dealing with untrusted input), so he decided to fix them nevertheless. This ended up being Parsedown 1.7. Everything else that wasn't considered to be "too annoying", got into Parsedown 1.8.

One of the biggest issues of Parsedown is that it has no extension API. However, there are indeed a lot of Parsedown extensions out there, including the official Parsedown Extra. All the changes Aidan made didn't affect Parsedown's public API, but it's internal behaviour, affecting extensions. So many extensions stopped working with Parsedown 1.7 - including Parsedown Extra. Development of Parsedown Extra is basically abandoned (and will likely stay abandoned, because it's no longer necessary when improving CommonMark compatibility). However, Aidan created a beta release of Parsedown Extra 0.8 extending Parsedown 1.8. Both are in beta. So, if you wanna use Parsedown Extra, you can choose whether you want to use Parsedown Extra 0.8 beta with Parsedown 1.8 beta, or Parsedown Extra 0.7 with Parsedown 1.6.

So, why is Parsedown 1.8 still in beta, it's code was mostly written mid 2018? Because Parsedown 1.8 is a very early snapshot of the code that much later became Parsedown 2.0. There will never be a stable Parsedown 1.8. However, Parsedown 2.0 isn't expected in the near future, too.

Parsedown 1.8 beta is as stable as Parsedown 1.7. Not sure whether "stable" is the right phrase, they do what they are supposed to do, but with a lot of issues. There aren't more issues with Parsedown 1.8 beta then with Parsedown 1.7, they are equally "stable".

To sum up, there are two reasons for Parsedown 1.8 beta:

  1. If you wanna use Parsedown Extra, you must use Parsedown 1.8 beta (unless you wanna rely on Parsedown 1.6 with a lot of known and super annoying issues)
  2. Parsedown 1.8 beta is just as stable as Parsedown 1.7

PhrozenByte avatar Dec 11 '19 23:12 PhrozenByte

I've disabled the ToS app to resolve the issue.

paulcalabro avatar Dec 14 '19 18:12 paulcalabro

This bug makes it impossible to use social login and PicoCMS on the same site. I am very sorry for that. I have used PiciCMS as an Intranet solution for communication to our users (currently 60 but potentially probably 3 times larger). Do I understand that you do not intend to solve this issue?

rollanders avatar Jan 25 '20 20:01 rollanders

@nickvergessen @PhrozenByte I will lift this issue as important to solve. I want both social login and PicoCMS

rollanders avatar Jan 31 '20 07:01 rollanders

Currently on NC 18 and was having the error Exception: Call to undefined method ParsedownExtra::textElements() but I don't have the Terms of Service app installed. Was finally able to find that the Issue Template 0.6.0 app causes this error also. After disabling this app my site loads. Thanks

hbdtech avatar Feb 07 '20 17:02 hbdtech

I can confirm this on Nextcloud 19 beta2 with the issue template app. Right after deactivating it worked.

mokkin avatar Apr 15 '20 15:04 mokkin