After updating from advagg version 8.x-2.x to advagg version 8.x-3.x Some parts of the CSS broke.
After commenting out the following code in \Drupal\advagg_css_minify\Asset\CssMinifier::optimize() the CSS was working again.
// Ensure that $data ends with ; or }.
if (strpbrk(substr(trim($contents), -1), ';})') === FALSE) {
$contents .= ';';
}
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | advagg-css-minify-breaking-css-2897869-8.patch | 697 bytes | Dumitru Grosul |
| #6 | advagg-css-minify-breaking-css-2897869-6.patch | 625 bytes | Dumitru Grosul |
Comments
Comment #2
nickdickinsonwildeDo you have an example of some CSS that it breaks?
Hard to fix/test without that.
Thanks;
Comment #3
nickdickinsonwildeWithout knowing the CSS that is having issues, haven't been able to reproduce.
Comment #4
carsonwI am experiencing the same issue on a D8 site we're building.
A semicolon is prepended to a CSS selector in odd places, causing that selector to be ignored.
After commenting out line 55 in CssMinifier.php, the bug no longer exists.
Here's an example of CSS where this happens:
The line in question is:
; .front-main-hero {Comment #5
carsonwComment #6
Dumitru Grosul commentedHad the same issue.
Apparently this happens when empty files are part of the aggregation.
Adding a patch here.
Comment #8
Dumitru Grosul commentedUploading a new patch with fixes based on testing feedback.
Comment #9
vladimirausThanks @dimag and everyone!
#8 fixed my issue.
Comment #10
pawandubey commentedPatch#8 works fine and verified the same.
RTBC+1
Comment #11
jeroent+1. But we probably need to add a test for this?
Comment #12
thallesIn this moment I think good solve the issue.
Can you create the tests on #3059999: Test to cover the changes on issue [#2897869]?
Comment #14
thallesThanks everyone!
Fixed!