Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.12
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2010 at 10:26 UTC
Updated:
11 Feb 2011 at 20:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
esmerel commentedShould be testable.
Comment #2
esmerel commentedI'm able to replicate this; the file is definitely there, but the theme information is not picking it up.
Comment #3
esmerel commentedComment #4
dawehnerYes, the problem is that the theme system replaces _ with -
Comment #5
dawehnerPerhaps views should do this on the admin page, too.
Comment #6
tic2000 commentedI actually did replicate this problem using a - in my tag too.
Comment #7
myxelf commentedThis behaviour will occur when the Views' tag contains any non-alphanumeric character.
The issue is coming from the solution given to: #354270: Allow Views Templates to Affect Views Output by Tag.
In theme/theme.inc:
$themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '-', strtolower($view->tag));This line is saying that all characters different from letters and numbers will be converted to a *hyphen*. Resulting in a mixture of underscores and hyphens, that later won't match in
format_themes()inside plugins/views_plugin_display.inc, specifically in:if (!$picked && !empty($registry[$theme])). Because the entries in$registryare using only *underscores* and$themeis mixed with *hyphens*.The line should be (note the *underscore* inside the preg_replace() function:
$themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '_', strtolower($view->tag));I have tried it and it works.
HTH
MyXelf
PS: I'm changing the title to something more descriptive. I'll also set the status to 'Needs Review' despite there is no patch attached, cause only one char needs to be changed. If you think that attaching a patch is required, I'll do it. Feel free to modify the information to whatever you see fits best.
Comment #8
dawehnerA patch helps people to do the same and allows the developer of views to apply this fix.
Comment #9
dawehnerPlease create one :)
Comment #10
myxelf commentedHere you have it.
Thanks
Comment #11
myxelf commentedChanging the status
Comment #12
tic2000 commentedI tested the patch using a tag with "-" and one with "_" and for both the template file suggested by Views worked now.
Comment #13
merlinofchaos commentedCommitted to all branches.
Comment #15
codycraven commentedRe-opened.
The same problem exists in 6.12. The patch in #10 still fixes the problem.
Comment #16
merlinofchaos commentedPlease don't re-open committed patches just because they're not yet in a published release.
Comment #17
codycraven commentedmerlinofchaos you commented that you committed the patch on October 12th. 6.x-2.12 was released on December 15th. I was assuming this was a regression. The patch is indeed present in the DRUPAL-6--2 branch, forgive my re-opening.
Comment #18
codycraven commentedComment #19
merlinofchaos commentedYou should read 2.12's release notes.