I've noticed that, when adding fields to a content revision page, the automatically generated machine names contain dashes. ('field_assigned_user-revision_id', for example.) This specifically seems to cause a problem when attempting to override the theme for the specific field with a template.
This all seems to stem from a dash being used instead of an underscore to combine the field name and the 'revision_id' string in field.views.inc, on line 191 (line 187 in 7.x-3.x-dev). Is there any reason I'm missing for the dash? Locally, if I change it to an underscore and re-create my fields, the field-specific template files immediately begin working. (Well, with a cache refresh.) I suppose it's mostly an issue with converting to and from dashes and underscores in the template file names, but machine name dashes seem inconsistent in general.
Comment | File | Size | Author |
---|---|---|---|
#9 | views-dashes_in_revision_fields_breaking_theme-1621560-9.patch | 1.42 KB | das-peter |
#6 | views-keep_field_column_separator_underscore-1621560-6.patch | 566 bytes | DrIPA |
| |||
#4 | keep_field_column_separator_underscore.patch | 566 bytes | Eric_A |
|
Comments
Comment #1
doktorjung CreditAttribution: doktorjung commented(I should specify that this is for 'Content(historical data)' fields.)
Comment #2
keesje CreditAttribution: keesje commentedI believe this is fixed somewhere between 3.7 and 3.10
Comment #3
mpadilla CreditAttribution: mpadilla commentedI think not. I have the same problem in views 7.x-3.14. I applied the same solution.
Comment #4
Eric_A CreditAttribution: Eric_A commentedSo here's a patch, presumably authored by @keesje, re-rolled by @eruiter. Traced it to this issue.
Comment #5
Eric_A CreditAttribution: Eric_A commentedComment #6
DrIPA CreditAttribution: DrIPA commentedRenamed patch to Drupal naming conventions
Comment #7
Eric_A CreditAttribution: Eric_A commentedNot sure about potential BC-issues, but if theming is broken... This is a straightforward bug fix. And then there's the matter of standardisation.
Comment #8
whthat CreditAttribution: whthat at College of Western Idaho commentedThis does appear to get the field template file names working! It also breaks existing content revision views with Broken/Missing Handle on each historical fields but these can be removed and added back to work.
The patch appears to be functional for proper template file naming on historical revision based fields.
Unfortunately I would need to wait until this is committed to a release before I would commit time to rewriting our numerous revision based views required for implementation.
Comment #9
das-peter CreditAttribution: das-peter at Cando commentedJust came across this issue and found a related issue #2335555: Display plugin (views_plugin_display) ignores template (tpl) files for a revision field.
I think we should incorporate the changes from both issues and it seems like there's a facility to "move" fields too - maintaining bc.
Attached patch should do the trick.
Comment #10
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedSetting back to Needs review per the comments and patch in #9