Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Dec 2013 at 18:20 UTC
Updated:
29 Jul 2014 at 23:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
longwaveThe attached patch fixes this, but I guess this means this handler has zero test coverage.
Comment #3
longwave1: 2149107-views-view-area.patch queued for re-testing.
Comment #4
dawehnerThe fix looks perfect, though we need some tests, so that never happens again.
Comment #5
longwaveAdded a test for this handler, including the "inherit arguments" feature.
Comment #7
damiankloip commentedCan this use Views::getView()
We could just ditch these as executeView will call setDisplay() anyway, which will just set 'default'.
Comment #8
longwaveChanges from #7 applied.
Comment #9
longwaveReuploading, as testbot seems to have eaten the last patch.
Comment #11
longwave...and then HEAD was temporarily broken :(
9: 2149107-views-view-area-8.patch queued for re-testing.
Comment #12
dawehnerLet's just add @inheritdoc there, so the commit is not blocked based on that.
I wonder whether we should use some xpath here/
Comment #13
damiankloip commentedHm, good point. I thought (assumed) this was a ViewsUnitTestBase test, maybe we could make it one of those?
Comment #14
longwaveI tried to use ViewsUnitTestBase but got stuck when Drupal\views\Plugin\views\area\View::render() checks access of the child view; it ended up calling user_access eventually and required the user and roles in the database, and I am not clever enough to figure out if there is a way to mock/stub that out yet.
Comment #15
longwaveI managed to convert it to a ViewUnitTestBase, turns out all I have to do is declare that the user module needs to be enabled. I couldn't find any xpath assertions available from unit tests, so I am still using strpos(), but I improved the first test to actually look for the class name of the embedded view.
Comment #16
dawehnerThat is fine for now
Comment #17
xjmThe whole functionality being completely broken is kinda major. ;) Thanks!
Comment #18
alexpottCommitted cfd1c3a and pushed to 8.x. Thanks!
Comment #19
xjmThe new test added by this patch is currently failing in HEAD:
So we need to either fix it or:
git revert cfd1c3ae@andypost is currently debugging but it might be better to revert and then fix the test. This patch last ran on testbot on Dec. 8.
Comment #20
berdirAttached is a patch that fixes it.
Quite sure that this is related to the base theme/theme callback issue that went in recently. it attempts to do a user_load(0) there, for some reason in \Drupal\user\Theme\UserNegotiator. Doesn't make sense, we should prevent that. Seems actually easy to do, so attaching an alternative patch that fixes a test by doing that. Note that I changed the constructor as well, because the current code already instantiates the user storage controller including it's dependencies (field.info service) even though we'll never nead that. Nicely shows the problem with injecting services that will not be needed, so a a lot of processing on for nothing.
Comment #21
berdirNote that the $user->theme thing there is also quite probably wrong, that's the field item list object, not the value. No test coverage for this?
EDIT: What it should be using is $user->getDefaultTheme()
Comment #22
webchickReverted c47f5c70e for now.
Comment #23
andypost+1 to alternative patch, anonymous user should not have theme fallback.
Not sure about
$user->themeseems we haveuser.datafor thatComment #24
berdirAs discussed in IRC, my vote is on committing the bandaid test fix, open a major or critical (functional and performance regression) issue about the UserNegotiator.
Comment #25
xjmDiscussed with @berdir. We'll open a separate followup for #1954892: Replace 'theme callback' and hook_custom_theme() with a clean theme negotiation system, which did also add the same workaround as in @berdir's first patch above:
+ public static $modules = array('user', 'field');Meanwhile, we'll add that same workaround to this patch.
Comment #26
xjmThanks @webchick!
Edit:
Dunno where that commit hash came from, but the correct commit did actually get reverted:
:)
Comment #27
xjmHere's @longwave's patch rerolled with @berdir's fix.
Comment #28
berdirOpened #2163035: Remove $user->theme and Drupal\user\Theme\UserNegotiator for the user negotiator problem.
Comment #29
berdirThat issue should now be an easy patch, I'd suggest to postpone this on that and then go back to the previous patch in #15 that doesn't need the workaround.
Comment #30
longwave15: 2149107-views-view-area-15.patch queued for re-testing.
#15 should be safe to commit again now #2163035: Remove $user->theme and Drupal\user\Theme\UserNegotiator is fixed.
Comment #31
berdirYes, the patch in #15 is RTBC again. Hidding all other patches that were posted in the meantime.
Comment #32
alexpottCommitted 2d92955 and pushed to 8.x. Thanks!