verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Lists (ol, ul) not imported by Feed Me plugin #173

Closed davorpeic closed 1 year ago

davorpeic commented 1 year ago

Describe the bug

Importing content from any format (json, csv) with some basic text and ordered and unordered list result in not importing lists, texts gets imported. Content is very basic even with test case and the same content mapped to Redactor fields gets imported ok, so I assume is some filter or protection activated in case of Vizy.

If you can point me in some direction would be great, thanks dp

Steps to reproduce

Test content to test the import

[
  {
    "title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus officia facilis, quisquam sed ratione architecto voluptatibus reprehenderit vel",
    "body": "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus officia facilis, quisquam sed ratione architecto voluptatibus reprehenderit vel</p><ol><li>Lorem ipsum dolor sit amet</li><li>Lorem ipsum dolor sit amet</li></ol><ul><li>Lorem ipsum dolor sit amet</li><li>Lorem ipsum dolor sit amet</li></ul>"
  }
]

Craft CMS version

4.2.1.1

Plugin version

2.0.6

Multi-site?

Yes

Additional context

No response

davorpeic commented 1 year ago

To test simple list I tried this input

"<ul><li>test</li></ul>"

Which resulted in Feed me log with this:

"mainContent":"[{\"type\":\"bullet_list\",\"content\":[{\"type\":\"list_item\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"test\"}]}]}]}]"

But this renders nothing in Vizy. Empty field. In the database that field has only empty array [] Strange

davorpeic commented 1 year ago

I traced issue that this is possibly related with how node types are called, I see issues with two words nodes (horizontal rule, bullet list) they all not get imported and I see mismatch in naming, somewhere is bulletList, and somewhere is bullet_list same with horizontalRule vs horizontal_rule.

engram-design commented 1 year ago

Yep, this would be due to using the outdated ueberdosis/html-to-prosemirror package which doesn't name nodes in camelCase.

Fixed for the next release. To get this fix early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-4 as 2.0.6",
  "...": "..."
}

Then run composer update.