locale_css_alter removes non-rtl files when using drupal_add_css with basename
Steps to reproduce:
1 - use drupal_add_css to add a file and add 'basename' argument
drupal_add_css('path/tofile/test', array(
'group' => CSS_DEFAULT,
'basename' => 'test-css',
));
2 - Create 2 files test.css and test-rtl.css
3 - Open an RTL page that should have the file.
Expected behavior:
test.css and test-rtl.css should be included.
Actual behavior:
only test-rtl.css is included on that page
Additional info:
drupal_get_css will remove the non-rtl file
if (isset($previous_item[$basename])) {
// Remove the previous item that shared the same base name.
unset($css[$previous_item[$basename]]);
}
Fix:
Changing basename alongside rtl path in locale_css_alter
Comment | File | Size | Author |
---|---|---|---|
#1 | locale-change_basename_in_locale_css_alter-2283601-1.patch | 1.03 KB | josebc |
Comments
Comment #1
josebc CreditAttribution: josebc commentedComment #2
josebc CreditAttribution: josebc commentedComment #3
josebc CreditAttribution: josebc commentedComment #4
josebc CreditAttribution: josebc commented1: locale-change_basename_in_locale_css_alter-2283601-1.patch queued for re-testing.
Comment #5
mgiffordIs this an issue in D8? If so, it would need to be fixed there first.
Comment #6
josebc CreditAttribution: josebc commentedI think this will not be an issue in D8 since i think it work's in a different way
please check https://www.drupal.org/node/2032405