Closed (fixed)
Project:
Taxonomy Views Integrator
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 May 2012 at 11:53 UTC
Updated:
15 Nov 2012 at 11:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
Eugene Fidelin commentedComment #2
kingandy+1 for this, these seem like the kind of persistent settings that would be appropriate for a variable.
The patch looks OK by eye but should really include a hook_uninstall in the .install file which removes all of the variables...
Comment #3
kingandy... Actually, as soon as I posted that I started to rethink. If there's potentially one setting per term and vocabulary, that could be a lot of settings ... my instinct is that if you're storing data about an entity - even if it's metadata - it should go in a database table. I'm honestly not sure which way I'd call this.
Comment #4
Eugene Fidelin commentedI don't think that there will be a lot of tvi settings.
For most terms will be used the same view as for vocabulary, only for some special terms different view will be used.
To minify number of variables you need to delete variable if checkbox "Use view override. " is not checked while term or vocabulary editing.
In this case you will have variable only for vocabulary and terms that have different view.
Comment #5
charlie-s commentedJust stumbled upon this but it's my opinion that settings related to what this module provides are not needed "site wide" and thus should not be in the variable table. You mention that a reason for this is that variable_get is cheaper than db_query, but the entire variable table is queried and loaded on bootstrap, affecting (however slightly) the overall page load. The variable table is not meant to be a generic storage system.
Comment #6
Eugene Fidelin commentedVariable table is specially designed to allow modules save their setting in common way and not reinvent the wheel :)
Comment #7
duaelfrEugene you are a king ! Thank you for this work :)
I also loved to see you transformed vocabulary ids in machine names which is often forgotten but really important.
However, your patch contains some coding standards issues that I fixed here [See #8 ;)].
I think the next step is to provide an integration with UUID module (I will open another issue for that)
The (very close) future of Drupal resides in Features-like integration. Storing configuration in a custom table without providing a common import/export API is really painful for people looking for an industrial way to develop, stage and deploy websites.
For those who care about performances issues :
See #8 comment for the good patch file...
Comment #8
duaelfrSorry, wrong patch file ^^
Comment #9
duaelfrNew version !
I removed a mistake from the previous patch and added an update path !
Please review !
Comment #10
duaelfrSometimes I might think twice before doing something ;)
New patch...
Comment #11
duaelfr++ Clever merge with #1684928: UUID integration
Comment #12
duaelfrNew version with upgrade path to replace vids by machine names
+ Clever merge patch rerolled
Comment #13
duaelfr13th is the good one ;)
Fixed upgrade path for vid -> machine names and schema -> variables
I won't change anything more ^^
Comment #14
Eugene Fidelin commentedNice patches DuaelFr.
I think module owner must include them in dev release.
Comment #15
duaelfrI lied :D
In this patch I added more consistency with other variables entries, using arrays instead of stdClasses. No upgrade path needed as old objects will continue to work and will be replaced by arrays at first save.
Again, it includes the merge diff to avoid collision with my other issue.
Comment #16
duaelfrThis patch has been rerolled and push to the 7.x branch.
It will be available in the next dev release.