Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This was possible in D6 and is very easy to fix in D7+
Comment | File | Size | Author |
---|---|---|---|
#113 | 1154382-view-mode-followup-112.diff | 7.19 KB | znerol |
#109 | 1154382-view-mode-followup-108.diff | 7.2 KB | znerol |
#106 | 1154382-view-mode-followup-103-do-not-test.diff | 1.92 KB | znerol |
#87 | drupal-view_modes-1154382-87.patch | 4.33 KB | plach |
#87 | drupal-view_modes-1154382-87.test.patch | 702 bytes | plach |
Comments
Comment #1
chx CreditAttribution: chx commentedNote that this is one of those API changes that are trivial to backport and as it is a regression I would love to see it backported to D7 and with versioned dependencies it's not an issue any more that previous D7 version havent had this.
Comment #2
BerdirSubscribe, I'd love to be able to rely on that in http://drupal.org/project/userpoints_nodeaccess which switches to a different view mode if you don't have access.
Comment #3
chx CreditAttribution: chx commentedComment #4
chx CreditAttribution: chx commentedAnd as this is a regression and a painful one, I am bumping to major.
Comment #5
sunSorry, but can you clarify what kind of edge-case scenario makes this issue major? If you want a particular $view_mode, then call node_view() with it.
I'm fixing the issue tags. But even if this may have been possible in CCK/D6, I not really sure whether it makes sense to support this in D7.
Comment #6
swentel CreditAttribution: swentel commentedSome bigger use cases:
Also, since view modes are now available on all entities, let's add them everywhere - patch adds them as well on comments, terms and users.
Comment #7
chx CreditAttribution: chx commentedWill work on tests. This issue literally stops sites from upgrading as there is absolutely no way to code around this and so it's major but not critical because if you dont meet it , your site is still working.
Comment #8
mlncn CreditAttribution: mlncn commentedAgree that this is major for the exact reason Swentel lists first-- but for testing, where is it possible to change the view mode? With the patch (applies as is to Drupal 7, will need to re-roll for 8 post /core) changing the view mode in preprocess is apparently still too late.
Comment #9
BerdirYou can set $entity->view_mode in http://api.drupal.org/api/drupal/modules--system--system.api.php/functio....
Comment #10
mlncn CreditAttribution: mlncn commentedThe view mode that is passed into node_build_content() is from the second parameter of node_view() which gets it from the second parameter of node_view_multiple($nodes, $view_mode = 'teaser', ...), not from the node object, and it is in node_view() that the view mode is assigned to the build array.
Therefore in this call stack, which is used when showing a node as a full page (and also, for that matter, when showing a node in a view rendered through Display Suite) changing the view mode in the node entity object with hook_entity_prepare_view() has no effect (Drupal 7).
For nodes, node_view() is where it matters what the view mode is. It calls node_build_content() in which hook_entity_prepare_view() is invoked after field_attach_prepare_view() (which receives the view mode as an argument). (Also, hook_entity_prepare_view() is not invoked for full nodes shown on their own page in node_build_content(), which is where this patch adds the
$node->view_mode = &$view_mode;
, line, because node_show(), which hardcodes the full display mode, uses node_view_multiple() marks the nodes as already prepared.)Regardless, changes to the view mode in implementations of hook_entity_prepare_view() are not reflected later in node_view() when the $build array is populated and the view mode assigned to #view_mode.
Using hook_node_view() alter to change just what is assigned the renderable array with #view_mode is effective apparently but does not change any of these earlier uses of view mode, including when doing the attaching fields preparation.
Comment #11
danielb CreditAttribution: danielb commentedAlright I've just written some contrib code that checks $entity->view_mode in Drupal 7. Doesn't work yet, of course, but it's in there now, so now everyone has to go along with it. :D
Comment #12
barraponto CreditAttribution: barraponto commentedI also noticed node_show() assumes a 'full' view mode. Can't we check for $node->view_mode first, and then go on? This would allow us to change build mode through hook_node_load() and might save the performance from loading the wrong build mode and its fields — for what it's worth.
Attached is a patch that implements that. I believe it adds to swentel's patch.
Comment #13
yoroy CreditAttribution: yoroy commentedbarraponto: I think you'll want to include the changes from the previous patch in yours, then set the issue to 'Needs review' to trigger the testbot.
Comment #14
barraponto CreditAttribution: barraponto commentedThere it is, merged with swentel's patch from comment #6.
Comment #15
Alan D. CreditAttribution: Alan D. commented+1 for getting this in. I'm looking at needing to do a domain access based view mode switch.
Note that this is possible in D7 by overriding the node/% menu callback and replicating everything bar the view mode changes, but that is just plain nasty!
Comment #16
Alan D. CreditAttribution: Alan D. commentedFollowing up on mlncn comments, how do you use this feature???
From testing using a number of different entity / field hooks had no effects with the supplied change. I didn't try any node hooks as I'm trying to get this working at the entity level.
Comment #17
xjm@Alan D.: What's stoppin this patch from getting in at the moment is a lack of an automated test that duplicates the bug. The test should fail without the patch here and pass with it. Thanks!
Comment #18
Alan D. CreditAttribution: Alan D. commented@xjm I'm not saying that there is an issue, I'm saying that I'm not sure how a developer will use it. We need to flick view modes per domain using domain access, and without overriding either the page callback or rendered #build, I can not see how to implement this.
Comment #19
rp7 CreditAttribution: rp7 commentedWondering exactly the same.
Shame this didn't get it in for 7.12...
Comment #20
swentel CreditAttribution: swentel commentedThe problem is that we need to find an early spot to alter the view mode, because as mlncn says, hook_entity_prepare_view simply wont' work. I think this rather calls for an extra alter hook, I'll see if I can experiment with this today.
Comment #21
znerol CreditAttribution: znerol commentedI agree with #20, there should probably be a new hook giving modules the opportunity to alter
$view_mode
for any entity before loading.For those like me who are in a need for this mechanism, I've setup a sandbox project which exposes the approach Berdir uses in userpoint_nodeaccess by means of a
hook_modeswitch_node_view_mode_alter(&$view_mode, $original_view_mode, $node)
. Keep in mind that this approach effectively results in loading nodes twice.Comment #22
Alan D. CreditAttribution: Alan D. commentedDomain View Modes does this too, by completely rebuilding the rendered node late in the view process within hook_entity_view_alter().
Comment #23
charlie-s CreditAttribution: charlie-s commented#15 I agree.
chx - thanks for pushing for this. I really hope to see this backported to D7. The idea of view modes without being able to switch when viewing a node via node/123 is nonsense. It's great for Views, embedded nodes, blocks, etc., but change view mode depending on context or role is quite powerful.
I really look forward to seeing this backported to D7.
Comment #24
xjmLooking into a test.
Comment #25
Alan D. CreditAttribution: Alan D. commentedCool, as least the tests will actually tell us how to use this!!
Comment #26
xjmAlright, so as far as I can tell #14 does not actually work. chx suggested instead adding a
hook_entity_view_mode_alter()
.Comment #27
BerdirThe reason that it doesn't work is that the only viable hook for this is hook_entity_prepare_view(). And that hook is already called in node_view_multiple() where there is no $node->view_mode.
The attached patch adds it early enough to nodes to check if that would theoretically work, as less sense as it makes (see comment).
Will try to create a patch using a new hook next.
Comment #28
BerdirGot distracted, attached is the version with the new hook. Completely untested but should work :) There is even the start of documentation for it ;)
There is one limitation of this approach, though:
This works for both
entity_view()
andentity_view_multiple()
. However, in the case ofentity_view_multiple()
, the(field/entity)_prepare_view
hooks run before theview_mode
can be changed. entity does not receive the view mode, so that's not relevant, but field does so a module could possibly do something based on the view mode, then that changes and things are messed up.I can only see one proper solution for that:
We change view/view_multiple() to work like load does. view() is nothing more but a wrapper for view_multiple() then we need exactly one place where we call the prepare_view hooks and can throw away the double-invocation protection and this also works reliably in all cases. Will hopefully happen when we introduce entity_view(_multiple)() in core...
Comment #29
xjmI can work with this. :)
Comment #30
kevinquillen CreditAttribution: kevinquillen commentedThanks Berdir. That hook was sorely needed in my case where we are using Mobile Tools to display content differently on various devices, in conjunction with Entity View Modes. I can now tell a user or node to load in a custom view mode on its detail page other than 'full' which would affect the desktop site.
Comment #31
charlie-s CreditAttribution: charlie-s commentedThat is awesome. Does this have a chance of being backported into 7?
Comment #32
xjm@csdco: It is tagged "needs backport to D7," so yes, we will try to make it backportable.
Comment #33
lahode CreditAttribution: lahode commentedWorks great, thanks Berdir
Although the patch provided in #28 makes a change on module/entity/entity.api.php which doesn't exist in the core.
So I put it in module/system/system.api.php and it does the trick!
Cheers
Comment #34
kevinquillen CreditAttribution: kevinquillen commentedSame, #28 works well but what is that path? I also used system.api.php.
Comment #35
aspilicious CreditAttribution: aspilicious commentedThis will need a reroll, for D8 as we entity is psr-0 now
Comment #36
acouch CreditAttribution: acouch commentedI'll try and re-roll this.
Comment #37
lahode CreditAttribution: lahode commentedHi again,
I notice this patch is not working with context module when I choose "node type" condition.
Do you have any idea why this happen?
Thanks in advance
Comment #38
lahode CreditAttribution: lahode commentedProblem came from context module in context.core.inc
I just added this hook to my own module and it works fine
Comment #39
BerdirPlease don't change the issue title.
Comment #40
swentel CreditAttribution: swentel commented@lahode The hook_node_view will never work, see the patch
Comment #41
acouch CreditAttribution: acouch commentedI re-rolled the patch from #28. Note that only the parameters changed. The interdiff is kind of irregular since I didn't actually add anything to the patch but shows the changes.
This still needs a test.
Comment #42
tim.plunkettLet the bot at it.
Comment #43
acouch CreditAttribution: acouch commentedAttached is a test for the node view mode change as well as the original patch.
Comment #44
BerdirYay, tests!
Some coding style issues and a suggestion to simplify the test code below. This currently only tests nodes, but that is afaik the only entity type in core that does have different view modes and we don't have entity_view() yet, so we can't do a generic test. So IMHO, just testing nodes is ok, maybe add a @todo that we should try to generalize the test case for all entities once we have entity_view().
TestS, I think.
should be "hook_node_view()".
The assertion messages should use single quotes as well.
Instead of using a custom menu callback and relying on arg() for the check (which will likely be removed in 8.x due to the request/response objects), I suggest you simply go to node/view/$nid and set a one-off variable, e.g. variable_set('node_test_view_mode', 'teaser') and then check that one in your alter function. Should save you quite a bit of code in the test module.
Comment #45
LoMo CreditAttribution: LoMo commentedI'll work on this. :-)
Comment #46
LoMo CreditAttribution: LoMo commentedHmmm... patch that was marked "green" is failing here. Let's test again.
#43: view-modes-no-longer-changed-1154382-41.patch queued for re-testing.
Comment #48
LoMo CreditAttribution: LoMo commentedOkay. I think I've fixed the test that was passing before so that it passes again. Just part of the code (lines before the added lines) has changed in current 8.x, so it wouldn't apply that part. I've looked it over and patched that part manually. Now for the tests which were always failing...
Hmmm... okay. I've made all the trivial changes to
NodeEntityViewModeAlterTest.php
, but I'm not familiar enough with how test sub-modules work to be sure I'd make the right changes to thenode_test.module
. So running tests, as it stands, still fails in the same way. I'll submit patches since now the main patch at least can be applied successfully and the test patch will at least have the "trivial" (coding standards) fixes, but either someone else should finish this or I could use some guidance.Comment #49
LoMo CreditAttribution: LoMo commentedLets run those tests... At least the main patch should apply, but I think the test is still failing.
Comment #51
BerdirThe test is supposed to fail without the new hook :)
The idea is that you first upload the test-only changes, so that it's visible that it does file and second the combined patch.
Simplified the test as suggested before, see interdiff.
Comment #52
aspilicious CreditAttribution: aspilicious commented...
4 days to next Drupal core point release.
Comment #53
Berdir#51: view-mode-alter-1154382-51.patch queued for re-testing.
Comment #54
BerdirUhm, that was a rather dumb variable name clash ;)
Fixed, also fixed the ending newline.
Comment #55
tim.plunkettLooks great! Still applies.
Committers, note that it adds a new file.
Comment #56
sunComment #57
webchickWe need to make sure that all hooks have an example with them. Other hooks in this file have examples, so this needs to conform.
Just asking (sorry, very distracted here at #mwds). In every other entity, this line is directly above the call to field_attach_prepare_view(), but here it's not. Here, it fires a $node = node_invoke($node, 'view', $view_mode, $langcode); first. Is that cool?
Comment #58
BerdirAdded an example.
The placement of the hook is correct, this is the node type view callback/pseudo-hook that is specific to nodes, no other entities have that and the hook needs to be called before that.
Comment #59
BerdirWe could theoretically remove the entity_type from the context now, and when doing that, we're left with just two arguments, so we could pass them directly instead of using a temporary $context variable, but it might be easier to do that in a follow-up issue because that won't be backportable. Or we can change it and then backport the patch in #58, opinions?
Comment #60
BerdirUpdated the patch as described in #59, feel free to RTBC the one you like ;)
Comment #61
Alan D. CreditAttribution: Alan D. commentedWhy! Without this it is impossible to determine what type of object that we are getting. #60 is definitely not ready to go, but I haven't reviewed #58Sorry, I was thinking about D7 not D8 (still on my first morning coffee)Comment #62
BerdirHave you look at the example code in the hook documentation? $entity is a classed object now, $entity->entityType() and you're done.
Edit: Double post ;)
Comment #63
sunFor D8, I'd actually prefer to do none of both, but rather:
That gives the full primary context to work with, and any additional context in the $context bag -- it's possible that we might want or need to add further data to $context later on.
That said, I wasn't exactly sure whether it wouldn't be better to pass the $entity first; i.e., so as to retain consistency with other entity API hooks?
Furthermore, I wondered whether there is room for a entity-type-specific alter hook like we do elsewhere? E.g.,
Comment #64
BerdirWe can't use drupal_alter() if we want $entity to be the first argument. Not sure if an entity-type specific hook is necessary, that means lot's of documenation and the additional condition isn't going to hurt IMHO, this isn't a hook like hook_node_*() that hundreds of are implementing.
Comment #65
BerdirHm. Already posted that.
Comment #66
BerdirOk, like this?
Now we have 3 possible implementations to chose from ;)
We really need entity_view(), then we don't have to duplicate all that code...
Comment #68
BerdirOk, that doesn't work, context needs to be a variable.
Comment #70
BerdirUpdated for the $modules dependencies thingy.
Comment #71
corvus_ch CreditAttribution: corvus_ch commentedI vote for for the patch in comment 70.
In most cases one will only need the view mode and the entity. All tough the context currently only holds one value, this solution gives us to option to add additional values without braking any existing code.
As for me this is RTBC but I leave it as is to see if it gets some more agreement.
Comment #72
tim.plunkettI agree.
Comment #73
BerdirNote: The alternatives to #70 (which I like as well, for the reasons outlined in the previous commit) are #60 and #58 (would require a re-roll to remove entity_type).
Comment #74
BerdirDouble post.
Comment #75
tim.plunkettCross post.
Comment #76
webchickCommitted and pushed to 8.x. Thanks! Moving to 7.x.
Comment #77
BerdirAttaching a backport that goes back to the comment #58 approach because that's the only thing that works for 7.x.
Comment #78
DamienMcKennaRerolled.
I'll reroll it again once #1067120: Missing hook_taxonomy_term_view() or hook_entity_view() when viewing a term is committed (fingers crossed).
Comment #79
DamienMcKennaI'm not supposed to RTBC a patch that I rerolled, right? Doh. Otherwise this looks good.
Comment #80
attiks CreditAttribution: attiks commentedI think for rerolls you can, but looks good to me as well
Comment #81
webchickAwesome, thanks folks for your patience while we got the threshold situation under control.
Committed and pushed to 7.x! Also added a CHANGELOG.txt entry for this.
Comment #83
plachSorry, but I have to reopen this one as there are multiple issues with it:
ENTITY_build_content()
is not propagated to the caller functions (usuallyENTITY_view()
). This may cause an inconsistent behavior for modules relying on the#view_mode
key set in the returned build array. For instance Entity view modes uses that key to add template suggestions for the main entity templates (e.g.node--article--my_awesome_view_mode.tpl.php
). Currently it cannot work because as soon as you implement the alter hook and change the node view mode from'full'
to'my_awesome_view_mode'
you get fields rendered with the custom view mode but the wrong template (node--article--full.tpl.php
).taxonomy_term_build_content()
it is intaxonomy_term_view()
, which is inconsistent with the rest of core entities. A module trying to implement the view mode alter hook for all entities may see an inconsistent behavior.The D8 patch is just a forward-port of the test-fix for the D7 bug + the original test file which didn't get committed.
The D7 patch fixes the bug by ensuring that the view mode key is set in the
$entity->content
key, which is more or less what D8 does. That value overrides the outdated one that would be set in theENTITY_view()
functions. It also updates the test to cover this and moves thedrupal_alter()
for Taxonomy terms call in the proper place.Attached also interdiffs/test only versions for reviewer's comfort :)
Comment #84
DamienMcKenna+1 for this. @plach: thanks for catching our slip-up.
Comment #85
webchickYeesh! Sorry about that. Committed / pushed the missing test (drupal-view_modes-1154382-83.patch) to D8.
Back down to D7 for review on those changes.
Comment #87
plachReuploading D7 patches.
Comment #89
plachComment #90
David_Rothstein CreditAttribution: David_Rothstein commentedDrupal 7.16 was a security release only, so this issue is now scheduled for Drupal 7.17 instead.
Fixing tags accordingly.
Comment #91
David_Rothstein CreditAttribution: David_Rothstein commentedAlso adding the "release blocker" tag (at least for now), since it seems there was a regression... and at a minimum we should understand exactly what that means before the next bug fix release of Drupal 7.
Comment #92
plachAgreed with the release blocker tag, however the initial backported patch already fixed the regression, the only problem is that it's only a partial fix. #87 should complete it.
Comment #93
plach:(
Comment #94
David_Rothstein CreditAttribution: David_Rothstein commentedI reviewed this pretty carefully and think it's ready to go. I don't really like marking it RTBC myself (since I'll probably be committing it too), but I think this followup is pretty straightforward, and it looks like @DamienMcKenna reviewed it a bit also. And I really want to get this committed so we can get Drupal 7.17 out the door.
But if anyone else wants to review this in the next day or two, that would be highly, highly appreciated :)
A couple comments though:
Probably this should be forward-ported to Drupal 8 once we're done here?
Specifically, the contextual links code is using the original view mode rather than the altered one.
I think this is a sufficiently small problem that we don't have to fix it right now (it's 50% an existing issue anyway), although presumably the fix simply involves having it check
$build['#view_mode'] == 'full'
instead.Comment #95
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted the followup to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/6e344fd49cdaf55a21f1ff16...
(Reviews certainly still welcome, though, especially before Drupal 7.17 is released.)
Moving this back to Drupal 8 for the other followups.
Comment #96
David_Rothstein CreditAttribution: David_Rothstein commentedI took a stab at a Drupal 7 change notification here also: http://drupal.org/node/1833086
Comment #97
BerdirUpdated the change notice with an example of how to use the new hook and described differences in 8.x so that we don't need a separate change notice there.
Thanks David!
Comment #98
znerol CreditAttribution: znerol commentedI quickly tested this on a site where I'm currently using the sandbox mentioned in #21. It works well - though I only alter view modes on nodes.
Comment #99
David_Rothstein CreditAttribution: David_Rothstein commentedThanks @Berdir and @znerol!
The additions to the change notification look good to me, although the fact that it's now tagged for both D7 and D8 seems to mean that it doesn't show up for someone skimming through either of these places:
http://drupal.org/list-changes/drupal?to_branch=7.x
http://drupal.org/list-changes/drupal?to_branch=8.x
Not sure what to do about that - maybe it would be better as two separate change notices after all?
Comment #100
Berdir@David: Looks like we have a bunch of those that contain both branches already:
"8.x, 7.x": http://drupal.org/list-changes/drupal?keywords_description=&to_branch=8....
"7.x, 8.x": http://drupal.org/list-changes/drupal?keywords_description=&to_branch=7....
So this is quite common but you did point out a valid problem with it.
Suggestion: Change the view filter configuration from an Equals to Contains instead of having to duplicate all those change records?
Comment #101
jcisio CreditAttribution: jcisio commentedShould we open a new issue in Webmaster and close this one?
Comment #102
BerdirHere is an issue for that #1867356: Change branch exposed filter on http://drupal.org/list-changes/drupal to CONTAINS, even if we decide to separate these change notices, it's still not something specific to this issue or needs a new one.
The view/render code has been completely rewritten in 8.x and a render controller has been added, not sure if there are still necessary follow-ups?
Comment #103
rp7 CreditAttribution: rp7 commentedI'm pretty much sure I have found a bug which renders this hook unusable (at least for node pages, node/%).
To simulate the problem (using a clean D7.17 installation):
change record:
Now, when you visit a particular node of type 'Article' as an anonymous user, the 'teaser' view mode will be used.
Basically, field_default_prepare_view() (which invokes hook_field_formatter_prepare_view()) is being run for the wrong view mode (in the example above, 'full'). This means taxonomy_field_formatter_prepare_view() is not being executed, causing the 'Undefined index: taxonomy_term' notice, and eventually causing the EntityMalformedException.
In the example above, if you add the 'Tags' field to the 'default' view mode, you will see the error disappears and all goes well (because taxonomy_field_formatter_prepare_view() will have been executed - although for the wrong view mode, but it makes the 'taxonomy_term' value available for later use).
Altough I haven't read this whole issue through - I *think* adding
before the node_view_multiple() call in node_show() would help us out here. This means hook_entity_view_mode_alter() will be invoked in 2 places, node_show() and node_build_content() - but I can't see much harm in this.
An extra benefit: a useless call to field_attach_prepare_view() wouldn't happen anymore either.
-
FYI: I used taxonomy as an example, but have also tested this with the node_reference module: exactly the same behavior.
Comment #104
znerol CreditAttribution: znerol commented@RaF: I cannot reproduce this. I use the following drush sequence:
Then create mymodule.info and mymodule.module according to the code from #103
At this stage the teaser is displayed properly no errors are shown and neither watchdog nor php error log indicate any problems.
Edit: Forgot site-install in drush transcript
Comment #105
rp7 CreditAttribution: rp7 commented@znerol
Your step #2 is wrong, it's the other way around. Navigate to admin/structure/types/manage/article/display and make sure tags are hidden. Navigate to admin/structure/types/manage/article/display/teaser and make sure tags are visible (formatter for example rendered taxonomy term / link).
Comment #106
znerol CreditAttribution: znerol commented@RaF: Thanks, I'm able to reproduce the issue now.
I think we need to better align
hook_entity_view_mode_alter
withfield_attach_prepare_view
andentity_prepare_view
. The latter two functions are designed to take multiple nodes in order to enable bulk loading of field values. However the alter-hook operates on one entity only.It is clear that the alter-hook needs to be called before any of the prepare-functions, that means it must be called on each node directly on top of
node_view_multiple
. After that the prepare-functions need to be executed on each set of nodes which have a commonview_mode
separately.A patch against D7 demonstrating the idea is attached (only for node.module so far). However the solution looks more than hackish and I hope someone has a better idea.
Comment #107
BerdirCan you confirm that this no longer happens in 8.x as we moved the code around there?
If so, this issue should probably be moved back to 7.x and get fixed there as I still don't know if there are any 8.x follow-ups here at all.
Comment #108
znerol CreditAttribution: znerol commentedI confirm that the problem does not exist in drupal 8. Actually
EntityRenderController::viewMultiple()
does more or less the thing I proposed in #106, i.e. batch load / build fields per distinctview_mode
. I consider this the way to go then.I'll put together a patch for D7 based on that approach.
Comment #109
znerol CreditAttribution: znerol commentedentity_view_mode_prepare
incommon.inc
invokinghook_entity_view_mode_alter
and returning an array with arrays of entities keyed by view mode.entity_view_mode_prepare
is invoked before any call tofield_attach_prepare_view
except innode_preview
.Comment #110
znerol CreditAttribution: znerol commentedComment #111
Alan D. CreditAttribution: Alan D. commentedComment #113
znerol CreditAttribution: znerol commentedFix stupid mistake in
entity_view_mode_prepare
Comment #114
znerol CreditAttribution: znerol commentedComment #115
znerol CreditAttribution: znerol commentedOK, test passed, comments very welcome. I'm especially unsure about my usage of
key
here.Comment #116
DuaelFrIt looks good to me znerol.
Berdir just pointed out this issue to me but I created another one with and easy step to follow to reproduce #1968348: (Change notice update) hook_field_formatter_prepare_view does not make use of hook_entity_view_mode_alter causing major errors.
We may continue this discussion there to clean and close this issue as we will need tests for your new function.
Comment #117
BerdirClosing this issue then, let's continue in the new bug report.
Comment #119
ianthomas_ukSee http://drupal.org/node/1154382
Comment #120
ianthomas_ukSorry, I didn't read this carefully enough - a patch was committed for 7.17 (#81), release notes at http://drupal.org/node/1833086
But it didn't work properly, which is why the followup issue http://drupal.org/node/1154382 was created.
Comment #121
xjmUntagging. Please remove the "Needs change notification" tag when the change notice task is complete.