Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Jan 2013 at 17:33 UTC
Updated:
29 Jul 2014 at 21:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerAwesome change!
We should fix all or none of them if possible.
Comment #2
damiankloip commentedThanks! Yeah, we should fix all of them, I thought I got them, but missed two! :)
Comment #3
dawehnerAwesome, with the assumption that we will add module = 'views' later
Comment #4
damiankloip commentedYeah, we need to decide how we deal with this for all plugins. I would vote that we just don't have this on any? As the Plugin manager adds views as a default but then I guess you could also argue that it is clearer if it's in the annotation...
Comment #5
olli commentedIs it ok to remove the prefix or should it be "views_"? Maybe it's me, but "created" looks little odd outside/without node.
Comment #6
damiankloip commentedWell, we don't prefix any of our own plugins. So I think how our is now is good.
Comment #7
damiankloip commentedWell, we don't prefix any of our own plugins. So I think how it is now is good.
Comment #8
olli commentedRight, didn't know that, thanks.
Comment #9
tim.plunkettIn #1879496: Do we need to worry about plugin ID collisions? we're talking about namespacing the plugins.
In addition, the fact that the "module" key can be left off for Views is a hack that we should remove.
So let's add 'views_' to the ones we're moving there, and not remove the module key.
Comment #10
damiankloip commentedI'm not sure about the prefixing just yet, as nothing is resolved in that issue. So here's a patch that adds just the module key to all annotations, and another one that also adds the views_ prefix to the plugin id.
I'm not sure how it's a hack that we default to a 'views' module key? Just like any other default for a definition really, no? :)
Comment #11
dawehnerJust to be more consistent I would prefer the first patch and adapt if we decide something else later.
Comment #12
damiankloip commentedYeah, me too.
Comment #13
tim.plunkettWell I definitely vote for the prefix one. I think it'll be more work to add the prefix later, and less work to remove it. But that's just me.
And the problem with the default of 'views' is that if a plugin author forgets the key, it won't blow up on discovery. And because the views module will be loaded, but not always their module, that module_exists call won't happen, and weird bugs will ensue. But that is a separate issue.
Comment #14
damiankloip commentedok, but I'm not sure we actually really use the module key. Except maybe in views_theme? Not sure how this will, if it will affect anything off the top of my head. It makes sense though, I'm happy this will be consistent.
tbh, I just want to get this in, which is actually the moving of the files, rather than discuss these other points, it seems like maybe these should be done elsewhere. Even if we flip a coin to decide which patch in #10 should go, I am happy :).
Comment #15
dawehnerThere seems to be only one valid way to determinate the winner ;) http://www.googlefight.com/index.php?lang=en_GB&word1=prefix&word2=module
Seriously I don't care much, as long it's not the current name.
Comment #16
damiankloip commentedDoes someone want to decide which one to use here?! googlefight says use the views_ prefix ....
Comment #17
olli commentedHey, lets do this without views_ prefix and googlefight in #1879496: Do we need to worry about plugin ID collisions?.
I'd be even fine with a date_ prefix: date_day, date_week, ...
Comment #18
dawehnerJust created an issue to test all these files: #1934558: Create a test for views date handlers
Comment #19
dawehnerIt seems to be that we don't really have a standard in core, so changing our behaviour and have a inconsistent piece seems worse,
so I would vote for the non-prefix variant.
Comment #20
damiankloip commentedok, let's settle on that then. I think if we change the plugin ids, we do this for all of them when/if there is a standard. Rerolled.
Comment #21
dawehnerYeah I agree!
Comment #22
webchickJust a question. Is there anything about this that's specific to a created date/time? Isn't it more dealing with timestamps as a general concept..? And if so, it seems like that would be a better name, no?
Comment #23
dawehnerYeah indeed, YearDate would work as well. It might make sense to get in the tests first, as it feels wrong to work on not tested code.
#1934558: Create a test for views date handlers
Comment #24
dawehnerRenamed all the plugins and files.
Comment #25
webchickCool, just committed that one. That probably means this needs a re-roll again (sorry!)
Also:
Careful. :D
Comment #26
dawehnerForgot to rename the created_day one. Sadly you didn't pushed the commit yet, so this is just a rerole for your great review!
Comment #28
dawehnerGood to know that the tests fail if we move things around.
Comment #29
olli commentedThis looks great now, but does not apply anymore.
We left a todo "remove the node dependency once the handlers are moved to views" in ArgumentDateTest. Can that be fixed here?
Comment #30
damiankloip commentedThanks! definitely we can remove that now :)
Comment #31
dawehnerOh nice cleanup!
Comment #32
olli commentedI think user module dependency came from node so we could drop all of ArgumentDateTest::$modules and ArgumentDateTest::setUp().
Comment #33
dawehnerYeah you are right.
Comment #34
damiankloip commentedAwesome. I totally didn't think about that!
Comment #35
olli commentedComment #36
xjm#33: drupal-1893906-33.patch queued for re-testing.
Comment #37
xjmComment #38
webchickCool, that's much better!
Committed and pushed to 8.x. Thanks!