Problem/Motivation

Batch compression shouldn't try to compress files that have been "disabled" in the UI.

Steps to reproduce

In Drupal 7 with the FontAwesome module, I've configured AdvAgg to compress javascript and have disabled sites/all/libraries/fontawesome/js/all.js from being compressed in the "Per File Settings" section. However, regardless of this, the JS batch compression task fails while trying to compress the file that should have been ignored and then blocks other remaining items from being compressed in the batch process as well.

An error occurred while processing advagg_js_compress_batch_process with arguments: 
Array
        (
            [filesize] => 3969933
            [mtime] => 1597208083
            [filename_hash] => lmROUSRAna3B-4fBjp4KTvvYRFV59pIK3Y99fR3-qIY
            [content_hash] => lgJ89a9idqI2J67OAysZbin4iIA5nhgYqPz14jSiK2E
            [linecount] => 7966
            [data] => sites/all/libraries/fontawesome/js/all.js
            [fileext] => js
            [cache_id] => advagg:file:lmROUSRAna3B-4fBjp4KTvvYRFV59pIK3Y99fR3-qIY
            [advagg_js_compress] => Array
                (
                    [1] => Array
                        (
                            [code] => -1
                            [ratio] => 0
                            [name] => jsminplus
                        )

                    [2] => Array
                        (
                            [code] => -1
                            [ratio] => 0
                            [name] => packer
                        )

                    [4] => Array
                        (
                            [code] => -1
                            [ratio] => 0
                            [name] => jshrink
                        )

                    [5] => Array
                        (
                            [code] => -1
                            [ratio] => 0
                            [name] => jsqueeze
                        )

                )

            [advagg_mod] => Array
                (
                    [contents] => Array
                        (
                            [drupal] => 
                            [drupal.settings] => 
                            [drupal.behaviors] => 
                            [jquery] => 
                        )

                )

        )

Proposed resolution

Don't batch compress assets that have been set to "Disabled" in the "Per File Settings".

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jwilson3 created an issue. See original summary.

jwilson3’s picture

Title: AdvAgg w/ JShrink fails on FontAwesome » AdvAgg batch compression fails on "disabled" script
Issue summary: View changes

Generalizing the title, because I don't think this has anything to do with the selected compression tool — this is a general bug in the module.

Batch compression shouldn't try to compress files that have been "disabled" in the UI.

jwilson3’s picture

Component: Code » Compression/Minification
marthinal’s picture

StatusFileSize
new1 KB

I've created a patch.

marthinal’s picture

Status: Active » Needs review
jwilson3’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @marthinal.

Patch works as advertised, to exclude specific files selected via the UI from batch compression tasks.

RTBC

  • thalles committed f2efea1 on 7.x-2.x authored by marthinal
    Issue #3164848 by marthinal, jwilson3: AdvAgg batch compression fails on...
thalles’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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