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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

josebc’s picture

josebc’s picture

Component: language system » locale.module
josebc’s picture

Status: Active » Needs review
josebc’s picture

mgifford’s picture

Is this an issue in D8? If so, it would need to be fixed there first.

josebc’s picture

I 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