backdrop-contrib / faqfield

This module provides a field for frequently asked questions.
GNU General Public License v3.0
0 stars 0 forks source link

Answer widget conflict: Formattable textarea vs. Paragraphs #5

Open olafgrabienski opened 1 week ago

olafgrabienski commented 1 week ago

I'm trying to use a FAQ Field in Paragraphs. In the field configuration I've set the Answer widget to "Formattable textarea". This works fine at first sight, I can create a FAQ section. However, when I edit the FAQs again, the content in the edit form seems to be removed. Instead of my content, I see the term "Array" in the editor (see screenshot below).

In the DBlog, I see the following notice:

Array to string conversion in check_plain() (line 2089 of my-path-to/core/includes/bootstrap.inc).

There is no issue when I change the Answer widget to "Textarea".


Answer widget is Formattable textarea: "Array" instead of content

Answer widget is Textarea: content is there

olafgrabienski commented 1 week ago

I've noticed there is no issue when I change the 'Default edit mode' of Paragraphs to "Open". So, there seems to be a conflict between the FAQ Field "Formattable textarea" and the 'Default edit modes' "Closed" and "Preview" from Paragraphs.

I'm not sure if this is a FAQ Field or a Paragraphs issue, so I have filed this report here also in the Paragraphs queue.

alanmels commented 1 week ago

Since you are using Paragraphs, have you considered using Paragraphs jQuery UI Accordion? That's what we do whenever we use Paragraphs (see, for example, https://www.homiebees.com/#faq).

olafgrabienski commented 1 week ago

@alanmels Thanks for your suggestion. I had considered Paragraphs jQuery UI Accordion, but I think, FAQ Field is a better fit for my approach.

Using Paragraphs jQuery UI Accordion, you have to set the Accordion format in the Manage display screen for your Paragraphs field, e.g. in a page content type. This way, you can't really use the same Paragraphs field with other Paragraph types. In contrast, FAQ Field defines the Accordion format on the Paragraphs type level. This is much more flexible, in my opinion.

So, I guess I'm still interested to get FAQ Field running for my use case.