Closed (fixed)
Project:
Development Banner
Version:
6.x-1.6
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2011 at 14:32 UTC
Updated:
22 Apr 2011 at 15:14 UTC
The body HTML element class is added without checking of other classes are present, if this is the case, last class get appended with dsv_banner ones.
Comments
Comment #1
pglatz commentedDo you mean where I'm adding the classes in dev_banner_preprocess_page() ?
$vars['body_classes'] .= 'dev-banner dev-banner-' . variable_get('dev_banner_position', 'nw');
Turns out this isn't really needed, but if it were, would the proper method be to split body_classes into an array, add the new class, and reassemble it? i.e.
$body_classes = array($vars['body_classes']);
$body_classes[] = 'dev-banner dev-banner-' . variable_get('dev_banner_position', 'nw');
$vars['body_classes'] = implode(' ', $body_classes);
I'm porting the module to D7 now, and have found some other areas of code that could be done better, like using behaviors to bind javascript events.
I appreciate you reporting this so my code would adhere better to d.o standards.
thanks, Phil
Comment #2
pglatz commentedCode has been updated, the line in comment #1 has been removed, and jquery now uses behaviors.
Please try latest versions (6.x-1.10, 7.x-1.1).