Broken markdown editor related to $this Kirby 3.7

Hi,

I’ve recently updated my site to 3.7, however, a user has reported a bug with the editor. They are seeing the following (below) when they try to add another text field.

undefined is not an object (evaluating 'this.$store.state.system.info')

Further to this, the rich editing features seem to be lost and the text renders like plain text.

I’ve just come across this issue thread - and it sounds like it might be related.

https://github.com/fabianmichael/kirby-markdown-field/issues/116

Any help is greatly received - thanks!

What does this mean, add another text field? The markdown field is only one field?

Hi, thanks for your reply…

Apologies - it’s when trying to add another block…

Still I feel there is some information missing. Are you using a custom block with the markdown field (because you linked to the plugin issues)? Or is this a standard markdown block that comes with the blocks field?

Did you delete the media folder after updating?

So yes, I deleted the media folder after updating.

It’s a standard text block with the markdown field.

A standard text block doesn’t use a markdown field. Could it be that you are using the old Editor plugin?

Quite possibly - is there a straightforward way of determining that?

Thanks

Check if the Editor plugin is installed in /site/plugins/ and if you have a field type editor in your blueprints. The Editor plugin was replaced by the blocks field in Kirby 3.5. You might have missed that if you updated from an earlier version.

I assume you did not create the site if you don’t know that?

Hmm… no Editor plugin and no field type editor in the blueprints…

No, I didn’t create this version of the site - the developer has since moved on. I built the initial site five years ago, so I’m coming back to it a bit rusty…

I’m still wondering where you are using the markdown field plugin you linked to in your first post.

This is all I have in my plugins folder.

Screenshot 2022-11-02 at 15.14.19

If I were to say delete the markdown-field the whole back end editing goes, so as far as I’m aware this is the only editing plugin I have.

The block that is having trouble is in my news article page:

This is the structure in the blueprint > fields > blocks

type: blocks
fieldsets:
  text:
    name: Text
    fields:
      text:
        type: markdown

Does that help in any way?

Ok, thanks, I tested this field now in a 3.8.8.1 Starterkit and it works without issues. Haven’t tested with 3.7 yet. When updating the site to 3.7, did you also update the markdown plugin?

So I’m actually on 3.7.4, but you know what I haven’t upgraded the markdown plugin :man_facepalming:

Is that likely to be the cause?

Worth a try in any case.

That seems to resolved the $this error - thank you. I replaced the plugin named ‘markdown-field’ with GitHub - fabianmichael/kirby-markdown-field: Super-sophisticated markdown editor for Kirby 3, community built. and renamed to kirby3-markdown-field

I’m still getting some funky default formatting though… it’s rendering as plain text with tags - any ideas?

Are those tags present in the content file?

They are yeah. However, not in all the most recent article which suggests they may have been copied from elsewhere.

But I don’t remember the monotype font being their previously?

Hm, I can’t tell what happened, they should not be there.

The standard text block in a blocks field uses a writer field internally. When you use this standard text block, content is stored with these p tags.

So the developer who set up this blocks field replaced the original writer field with a markdown field for some reason.

In my test with your setup, however, there are no p tags stored when using the Markdown field.

So you probably either have to remove those p tags again from your content files, or live with them being stored and displaying in the Panel (guess it doesn’t make any difference on the frontend?).

Check if you get any p tags when you create a new page with the updated Markdown field.

OK thanks, I can probably remove them, and correct it doesn’t have an effect on the front end.

I’ll check for p tags when I create a new page.

What I’m trying to work out is how to restore the rendered view. This is what I currently have: