One thing I never completed in my design was that the export routine is supposed to export based on option definition. One benefit to this is that we could then properly export t() flags, as well as make other decisions if we need to. Another benefit is that we could do a better job of avoiding exporting data that does not need to be exported, which there is quite a lot of in the current Views 2 exports.
This is a partial, incomplete patch to do this.
Remaining TODO:
- Document the methods.
- Provide export methods for exporting plugins on displays: cache, style_plugin, row_plugin.
- Retool plugins so that they *all* use option_definition.
It's funny because I'd actually documented and partially implemented some of this but I clearly had cheesed out partway and just wanted to get it done. This needs to be finished.
Comments
Comment #1
merlinofchaos commentedHere is an example of what the new export looks like.
You can easily see the unfinished parts.
Comment #2
merlinofchaos commentedI think this needs to be doen as part of Views 3 ASAP in order to move forward translation, but also to get all the plugins on the same page. I am embarassed at how horribly inconsistent plugins are right now.
Comment #3
dawehnerHere is a updated patch.
DO NOT USE THIS PATCH UNLESS YOU KNOW WHAT YOU DO, ITS BROKEN.
Comment #4
dawehnerignore the old patch.
Comment #5
dawehnerSo here is the right version
Comment #6
merlinofchaos commentedAttached is a patch that adds options to export the style and row style. Hopefully this demonstrates what I meant.
Still TODO:
I hope to work a little more on this today.
Comment #7
merlinofchaos commentedOk, this handles #1 and the 'style' part of #2 above.
#3 is easy.
It also fixes some brokenness, makes sure relationship data is exported.
Argument default/validate handlers are going to require some thinking. My thinking right now:
The trouble I have with that is that all argument/validate handlers have to be rewritten. This probably isn't actually a bad thing. This is 3.x and we're mandating it, and it will make them a lot more robust. It should pobably happen as a patch separate to this, though, so it can be more easily documented for module developers upgrading their stuff.
The biggest worry I have, now, is that handlers and plugins could easily have non-declared data that got stored that they rely on. Since there's so many handlers and plugins, we more or less have to check *each* one and see if they are storing data that is not declared. This is mind-numbingly tedious, but probably necessary.
Comment #8
merlinofchaos commentedOk, here's a new patch. This converts argument validation and default plugins. We could probably do with special handling for table, but that isn't critical and might be a good choice for a followup patch.
At this point I think we need some pretty good testing. Make some crazy views, export and import them and make sure they're the same. =)
Comment #9
yhahn commentedEarl: You are a monster. Nice work : )
Comment #10
dagmarI have a small question about this patch. What happens if a user install packaged view from a feature with a previous version views export system, Does it work?
Comment #11
merlinofchaos commentedYes, it shouldn't invalidate old exports at all. They will simply be less rich.
Comment #12
merlinofchaos commentedI went ahead and committed this to 6.x-3.x -- it now needs to be ported to D7. Hopefully that isn't difficult!
Comment #13
dawehnerThis patch waits for group by support
Comment #14
dawehnerHere is a initial version.
Directly related issues:
#664518: Group by doesn't work well after retool export system
#664382: Fields cannot be exclude after Retool export system
#645146: Filters cannot be exposed anymore after "Retool exports to drill down properly"
#670874: Argument validation doesn't get saved
Thats a diff, to the groups-by patch already used, i like git here!!!
Comment #15
dawehnerHere is a relative complex view and i tested.
Comment #16
dawehnerWTH. why is this old style export.
Comment #17
dawehnerMan i'm silly. i didn't changed the branch.
Comment #18
dawehnerupdate stuats
Comment #19
Scott Reynolds commentedTested with the following View. It uses the table style with a group by, with a relationship different fields are rendered as links and hide if empty stuff. the options carried through when exported and re-imported.
Now this patch is HEAVY, but I read through and get the gist of it. It did fail to apply for me in two spots, one was a new line, and the other was in admin.inc, hence why I rerolled it. And its a CVS diff, which means that it might not put the views_plugin_argument_default_fixed.inc in the right spot
Comment #20
dawehnerThx. I commited the patch