I just encountered https://www.drupal.org/project/minifyhtml/issues/3041125

The module failed in a way that rendered the page mostly white and unusable. Since we know that if "%MINIFYHTML_" is left on the page after minifyhtml finishes, the minification failed, I think the module can fail and let a user still use the page.

I've provided a patch that checks if "%MINIFYHTML_" is still in the code, and if it is, resets the page to the original un-minified code. Then it sets a watchdog warning so admins will know the page isn't minified.

The patch could be better if we added an admin interface to control if the module fails hard or soft. With the setting disabled you can trace how the page failed a little easier. While it is enabled regular users encounter a working page and face no interruption of service.

CommentFileSizeAuthor
#2 minifyhtml-fail_soft-3041131-2.patch611 bytessadiefp

Comments

sadiefp created an issue. See original summary.

sadiefp’s picture

StatusFileSize
new611 bytes

  • sadiefp authored da493c0 on 7.x-1.x
    Issue #3041131 by sadiefp: Fail Less Hard
    
slydevil’s picture

Assigned: Unassigned » slydevil
Status: Needs review » Patch (to be ported)

Need to port this to D8

  • sadiefp authored 2ee5314 on 8.x-1.x
    Issue #3041131 by sadiefp: Fail Less Hard
    

  • sadiefp authored 26f858e on 7.x-1.x
    Issue #3041131 by sadiefp: Fail Less Hard
    
slydevil’s picture

Status: Patch (to be ported) » Fixed
slydevil’s picture

Status: Fixed » Closed (fixed)