This is a follow-up to #2287805: Caption filter does not work with Quarter Size image format - or with floated captions.

Basically, if you process content that includes duplicate IDs, for example:

<div id="not-unique">First</div>
<div id="not-unique">Second</div>

... with the 'panopoly_images_fix_captions' filter, it'll generate this warning:

Warning: DOMDocument::loadHTML(): ID not-unique already defined in Entity, line: 1 in _panopoly_wysiwyg_process_caption_filter() (line 392 of /panopoly_wysiwyg/panopoly_wysiwyg.module).

This is mitigated by the fact that the Panopoly WYSIWYG text format actually won't let you specify IDs at all. So, this can only be triggered by a user defined text format which allows IDs, or by modifying the WYSIWYG text format to allow them. However, I have seen this come up on a client site!

While this is invalid HTML, we should silently ignore that if possible! Based on my research, calling libxml_use_internal_errors(TRUE) should fix this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Status: Active » Needs review
FileSize
1.11 KB

Here's a patch that works in my testing!

  • dsnopek committed e64df17 on 7.x-1.x
    Update Panopoly WYSIWYG for Issue #2491521 by dsnopek: Warning when...
dsnopek’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.