When outputting a template for a list view (from CCK nodes) the tpl file is filled with incorrect variables like this:
print $field-release-date-value
The result is that fields aren't displayed.
By substituting hyphen with underscore, everything works:
print $field_release_date_value
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | views_theme_wizard.module_0.patch | 972 bytes | Permanently Undecided |
Comments
Comment #1
Permanently Undecided commentedI can confirm this and also that the fix suggested works perfectly.
Comment #2
Anonymous (not verified) commentedAnother confirmation. It solved my problem http://drupal.org/node/105193
Thanks for the info.
Comment #3
dodorama commentedjust to rise attention on this bug
Comment #4
Permanently Undecided commentedHere's a patch that fixes this.
What was the problem?
Basically, the Drupal way is to name css identifiers with hyphens (-) and to never use underscores (_), even though according to the w3.org specification you can use both: .
In order to follow the Drupal's css identifier naming guidelines, all the names were sanitized using the function views_css_safe() that substitutes underscores with hyphens. However, instead of doing this for css class names only, this was also done for actual field names, which caused the bug.
My patch adds a new variable that holds the sanitized field name to use with css classes, and keeps the correct, unsanitized field name to use with, obviously, fields.
Comment #5
merlinofchaos commentedThanks for the patch, PU! Applied. Sorry about the delay, the holidays have had me quite busy.
Comment #6
(not verified) commented