Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Oct 2012 at 09:33 UTC
Updated:
29 Jul 2014 at 21:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damiankloip commentedSorry, had some unrelated stuff in there.
Comment #2
damiankloip commentedNote to self: In the next patch remove $usesAttachments property from CallbackPluginBase.
Comment #4
damiankloip commentedChange in #2 and $handlers property on DisplayPluginBase.
Comment #5
damiankloip commentedfrick.
Comment #7
damiankloip commentedHopefully this will be closer to passing now, Small changes first.
Comment #9
damiankloip commentedMaybe path wasn't being saved for feeds..
Comment #11
damiankloip commentedDon't forget to call the parent.
Comment #13
damiankloip commenteddawehner spotted that the remaining test was failing as it was expecting feed to be in the list of available displays to 'Attach to', which is totally wrong. We don't want to do that.
This patch removes feed from the list of available displays as it no longer inherits the $usesAttachments property from the Page display as it did before.
This should pass now, lucky number 13.
Comment #14
damiankloip commentedAdded another condition in acceptAttachments to check for the current display of the view.
Comment #15
dawehnerGreat improvement! I know that many of the code is just moving around, so i don't nitpick on that.
I'm not sure whether the classname helps to understand the purpose behind it. The name doesn't tell you that hook_menu is used. What about ControllerPluginBase so Controller in terms of symfony router controller.
Just in general we should be able to drop that now. $arg was used in d5
Comment #16
damiankloip commentedThanks! I was going to speak to you anyway about the name of the base class (I might have mentioned it above somewhere too), Callback is not the best; I'm not sure about controller either :? We have alot of controllers in Drupal now. This patch changes it to path, how about that?
Comment #17
dawehnerOH sure that is a good name, at least for now.
Comment #18
damiankloip commentedSorry, with amended docblocks.
Comment #19
webchickHere's some feedback. Sorry if I'm asking dumb questions, this is my first time in a long time really looking deep into Views code.
A lot of these are nitpicks, but one key piece of feedback is:
I will say I find the old version of this a lot more understandable. :(
Can Path not be a "decorator" type pattern, rather than a brand new thing from which Page-based displays to derive?
Basically, I would love more information on why this is a good idea, or what specific problems we're trying to solve here that would make the "learnability" trade-off worth it.
Here's the rest.
That indeed describes what the code down below says, but it doesn't tell me why. Why do we disable attachments on the current display?
There are some hunks in this patch where you remove this comment, and then others where you add it, and others where you add a call to the parent but don't comment it. Why? Seems like we should be consistent.
Isn't that still relevant?
These are all just copy/paste comments, so no need to fix them here, but let's get a follow-up cos there are a number of standards violations here ("Capital" on start, ending with period, 80 char wrapping, etc.)
Doesn't that go in contextual.module, per #1817698: Move contextual links field handler out of views.views.inc and put it into contextual_links module?
views_ui_truncate? Ew. :) Seems like we need to abstract that into a general helper function (looks very similar to _filter_url_trim). Separate issue, obviously.
Didn't we just remove some test coverage?
Comment #20
dawehnerMaybe we have to find a better name for the hook_menu base-class, so it would be easier to get? A longer explanation for the route follows.
So we have a really generic class (DisplayPluginBase) which allows a view to be displayed anywhere (block, page, panels etc.).
A common use-case is to have a view be displayed on a path, so there should be another base-class which provides the fundamental features
required for a hook_menu entry + callback. The previous code instead extended Feed from Page (an actual page with blocks etc.) and removed the features which aren't required for a feed, so we basically try to clean things up. For me the decorator pattern seems to be a way to extend classes horizontally, which is not required here, and so would be harder to understand.
Does this help better to understand it?
This happens if you just move code around :) I removed the all, because this really doesn't improve it.
You are right, it should document it, but use path type.
Sounds like a good follow-up issue: #1825230: Fix documentation standards in PathPluginBase/Feed/Page
Good question. At least the constant and menu_contextual_links is part of menu.inc. I'm not sure but it could be hard to understand, if contextual module is doing some additional altering.
The test was actually wrong, you should not be able to attach a display to itself. This caused the error in #1821654: Refactor Page based display plugin classes and got fixed by the
second hunk you reviewed above.
Comment #21
damiankloip commentedComment #23
damiankloip commentedre rolled
Comment #25
dawehner#23: 1821654-23.patch queued for re-testing.
Comment #26
dawehnerWe need the refactoring in, and we can cleanup later.
Comment #27
xjm#23: 1821654-23.patch queued for re-testing.
Comment #28
tim.plunkettOther than a couple nitpicks, I think this is RTBC.
Here and everywhere else, should be \Drupal
Switch to "Contains"
It seems ridiculous to have a switch with only one case when the code has lasted like this for so long.
Comment #29
damiankloip commentedThanks for reviewing, I have made those changes. It's a good point about the switches, I have changed them for if statements.
Comment #30
damiankloip commentedComment #31
tim.plunkettThanks!
Comment #32
webchickCommitted and pushed to 8.x. Thanks!
Comment #33.0
(not verified) commentedUpdated issue summary.