Problem/Motivation

Cookies Asset Injector does not check if asset is enabled. Even disabled asset injector snippets are handles in Cookies Asset Injector.

I saw this because we're having the know issue:
Exception: Error trying to optimize JavaScript asset: sites/default/files/asset_injector/js/usetiful-0bd299061037d2e0e13e3a0f0aa9fce8.js. Only file JavaScript assets with preprocessing enabled can be optimized. in Drupal\Core\Asset\JsOptimizer->optimize()
in a client project where the related asset is disabled.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork cookies-3565611

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Assigned: Unassigned » grevil
Status: Active » Needs review

Okay I found and fixed the flaws. The parameters can be removed, they are not helpful for us and we can't pass them everywhere usefully. So let's remove them and add a missing check!

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs review » Reviewed & tested by the community

LGTM! The test fails, because of the Matomo submodule, which definitely has no dependencies on the asset injector cookies submodule.

  • anybody committed 58703c58 on 2.x
    Issue #3565611 : Cookies Asset Injector does not check if asset is...
grevil’s picture

Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)

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