Closed (fixed)
Project:
Entity view modes
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
4 Nov 2012 at 21:22 UTC
Updated:
25 Mar 2017 at 20:42 UTC
Jump to comment: Most recent
Comments
Comment #1
dave reidAren't suggestions supposed to be ordered specific to general? That way if you have a specific override it gets used in precedence over a more general one?
Comment #2
Anonymous (not verified) commentedMaybe I phrased my issue poorly.
The patch fixes a problem where the array is being searched for a value, and if that value does not exist, it uses uses the index of the same value it just searched and did not find to splice a new value into the array. Since that value doesn't exist, the index is always 0, so it always adds it at the top.
It's clear that the code chunk is supposed to be just like the ones around it... it searches for the appropriate less specific thing to add something more specific after it. However, there's a typo in the code as it is. It searches for the thing it's trying to add.
Comment #3
dave reidMakes sense. Will try to commit soon but I want to get a quick test written to confirm the suggestion behavior and ordering.
Comment #4
Anonymous (not verified) commentedDave:
I'd be happy to take on the task of writing a test to validate the suggestion order. Should this be part of this issue or should I open a new ticket?
Comment #5
dave reidI'm working on some tests but I managed to reproduce the condition in which this happens by temporarily hacking some existing template suggestions in core to meet the conditions in the issue. Committed to 7.x-1.x. http://drupalcode.org/project/entity_view_mode.git/commit/56c2c13