Modules or themes that that rely on calls to drupal_render() in filters may end up with images being incidentally processed multiple times. A quick fix is to guard processing the filter by checking if the data-src attribute exists on elements. Suggest updating line 122 of lazy.module to:

if (!in_array($opt_skipClass, $classes) && !$element->hasAttribute($opt_src)) {

Comments

tphang created an issue. See original summary.

tphang’s picture

The following patch attempts to make the _filter_lazy_process method idempotent by adding an element-level check for the lazy attribute as suggested above.

  • osman committed 47e0f91 on 7.x-1.x
    Issue #3202621 by tphang: Lazy text filter applied repeated
    
osman’s picture

Status: Active » Fixed

Thanks for the patch.

Status: Fixed » Closed (fixed)

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