Inspired by how og_views handles this, I think it'd be nicer on a few different levels if each default view we provided lived in a separate file:
- Easier to find the code you're looking for
- Easier to document each view
- Easier to paste views export output since things don't have to be indented
- Easier to do CVS blame and generally do revision control archeology if the views are in separate files
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 460248-1.split_default_issue_views.patch | 161.62 KB | dww |
Comments
Comment #1
dwwThis patch does the following:
Any objections?
Comment #2
aclight commentedIt seems to me that this split would make exporting views even more of a pain, at least during development, as we'll need to either specifically check each project* view to see if we've changed it during development or re-export each of them separately. As it is currently, you just need to check all the appropriate views, export, and copy and paste into the default views file. This will also make creating patches that contain new views more difficult since you have to edit CVS/Entries manually to add the new file.
But certainly your other points are valid. What would be super handy is if the views_export module could export each view into a separate file of its own, giving it the appropriate name, in the appropriate directory.
I'm sort of on the fence about whether this is a good idea or not, but you're the one that's been doing the majority of the development recently, so if you think this is an improvement then I'm fine with it.
I didn't review the patch itself but what you described in #1 makes sense.
Comment #3
dwwA) Our default views are not just paste-over-able. There's some somewhat sketchy dynamic logic in there, e.g. to conditionally add filters for issue taxonomy terms for sites that run with comment_alter_taxonomy and issue tags, to dynamically do a bunch of things differently if search.module is enabled, etc. So, you can't just blanket export and paste, or you break things, anyway. I was more thinking about pasting sections of the views, or at least pasting new views if they don't do any dynamic stuff yet. ;)
B) Views tells you what you've changed, since the view is either "Disable" or "Revert". So, if you're changing things, you know exactly which ones you've changed anyway.
C) I'm not so concerned about adding new views via patches requiring new files. You don't need to manually edit CVS/Entries -- that's only for core where it's impossible to login as an authenticated CVS user. So long as you're authenticated at all, CVS will let you run "cvs add" (even if our ACLs prevent the corresponding "cvs commit"), and then you can see the new files with "cvs diff -upN".
Yeah, that would be a nice feature for views_export. ;) But, it wouldn't help us much, given how unholy our default views are (as per A).
Comment #4
aclight commentedAh...I didn't realize we had conditional code in the default views, though that makes sense. So in that case, I guess splitting them up doesn't cause any new problems and solves some current problems, so sounds good to me.
Comment #5
hunmonk commentedthe idea makes sense to me.
should that require be a require_once?
Comment #6
dwwSure, require_once is fine.
Are we all in agreement with views/default_views as the location for these? the other subdirs in there are called "handlers" and "plugins". Should this one just be called "views", or is that more confusing?
Any other objections?
Thanks,
-Derek
Comment #7
aclight commentedI like views/default_views
Comment #8
dwwCommitted to HEAD.