If Collapse Text is used with WYSIWYG editor, the errors appear. WYSIWYG converts quotation marks to entities: & quot; and Collapse Text can't understand such lines:
[collapsed title=& quot;A title& quot;]
and explodes in simplexml_load_string() function:
Entity: line 1: parser error : attributes construct error in simplexml_load_string().

Maybe Collapse Text should be able to understand such escaped attributes and unescape them when necessary.

Comments

maximpodorov created an issue. See original summary.

maximpodorov’s picture

Issue summary: View changes
dydave’s picture

Title: Collapse Text vs WYSIWYG battle » simplexml_load_string parser error when used with wysiwyg
Priority: Major » Normal
Related issues: +#1958468: simplexml_load_string() parser error, +#1120066: Support for width="123px", +#2487193: Support double quotes in the title attribute

Hi,

Thanks for posting this issue.
This has actually been a long lasting problem with collapse_text, which unfortunately sits at the foundation of the module.

This is certainly an issue that should be watched carefully....

I have tested again with collapse_text-7.x-2.x at 686576f and wysiwyg-7.x-2.2+75-dev with CKEditor and wasn't able to reproduce the error, on a simple test case scenario.

If anybody encounters this problem again, could you please provide more information about:

  • The text format used and in particular the order of the filters configuration
  • Any special wysiwyg configuration for the text format
  • Screenshots would be great
  • a copy/paste of the exact error encountered
  • a copy/paste of the code used in node's body, which prompted the error

Ideally, I would need to be able to reproduce the exact same steps taken which led to the error message.

Also, before reporting here, could you please first test the patch at #2487193-1: Support double quotes in the title attribute? Reporting your test results here or in that issue, would be very helpful.

Thanks in advance to everyone for your testing, reviews, reporting and feedback.
Cheers!

AmiGator’s picture

Hello, same Error

Warning: simplexml_load_string(): Entity: line 1: parser error : attributes construct error in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): <collapse collapsed="collapsed» title=""Я внутри""/> in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): ^ in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): Entity: line 1: parser error : Couldn't find end of Start Tag collapse line 1 in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): <collapse collapsed="collapsed» title=""Я внутри""/> in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): ^ in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): <collapse collapsed="collapsed» title=""Я внутри""/> in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).
Warning: simplexml_load_string(): ^ in _collapse_text_process_child_item() (line 522 of  \sites\all\modules\collapse_text\collapse_text.module).

Occurs in all cases. If you disable "Correct Faulty and Chopped" error goes away, but the spoiler is revealed when you press. I've disabled all the filters, it doesn't help

screenshot of Filter List — https://img-fotki.yandex.ru/get/62989/9638899.3aa/0_ebc24_39a68c38_orig.jpg

dydave’s picture

Status: Active » Closed (outdated)

Drupal 7 is not supported anymore, therefore this issue is unlikely to go any further.

Additionally: No activity or reply for more than 6 years.

If this issue is still valid for more recent versions of the module and Drupal core, please create a new ticket with the appropriate version.

Marking issue as Closed (outdated), for now.

Thanks everyone for your interest in the Collapse Text module and contributions! 😊

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.