Closed (fixed)
Project:
Viewfield
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
12 Jun 2009 at 15:46 UTC
Updated:
22 Apr 2011 at 18:42 UTC
Jump to comment: Most recent file
When I create a viewfield, and I want to force default, there is no way for me to set the view argument per instance-- I have to set it "globally", for all instances. This means that I cannot change the view via arguments for each node type to which the field is added. It's a minor annoyance, but I've run into it a lot.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | per-field-instance-default-value-settings-489908-15.patch | 16.58 KB | keithm |
| #13 | per-field-instance-default-value-settings-489908-13.patch | 16.74 KB | keithm |
| #12 | 489908-per-field-instance-default-value-settings-12.patch | 16.92 KB | keithm |
| #10 | viewfield-instance-7.patch | 14.26 KB | keithm |
| #8 | viewfield-instance-6.patch | 14.47 KB | keithm |
Comments
Comment #1
cmjns commentedComment #2
yched commentedWhat makes you think this is a CCK issue ?
Comment #3
jerdavisThis is something we can look at further once we're able to take a pass at how defaults are handled.
Jer
Comment #4
sunFirst stab at this. Patch is getting larger than the entire module though. ;)
The module update path for this patch may delay the next release.
Comment #5
BenK commentedSubscribing...
Comment #6
dig1 commented+1 especially for http://drupal.org/node/704014
Cheers
Comment #7
keithm commentedI rerolled #4 for the current 6.x-1.x-dev. The rerolled patch applies cleanly and works pretty well, passing a argument per content type and/or per instance. Legacy tokens (e.g., %nid) are working fine but token module tokens are not working.
Comment #8
keithm commentedUpdated #7 to fix Token module replacement and remove the 'token_enabled' concept. Legacy token and Token module token arguments should both work now, per content type or instance.
I'd appreciate some feedback on this patch.
Comment #9
sunThis looks odd -- are the widget settings really available in field settings...?
Why is the #default_value changed to the first value of #options here? That doesn't look correct to me.
Let's not duplicate the code for this #description
Powered by Dreditor.
Comment #10
keithm commentedYes, this is wrong. Reverted to original (pre-patch) code.
The code in the patch:
is derived from this section in viewfield-6.x-1.x-dev :
The logic in the 1-option case remains essentially the same.
Removed duplicated legacy token #description in viewfield_elements().
Comment #11
attiks commentedPatch is working for me
Comment #12
keithm commentedPatch now includes code to migrate global default value settings to instance level.
Comment #13
keithm commentedPatch rerolled for latest dev. Please review and test. Once this patch is committed I'll move to the D7 port.
Comment #14
sunOh, we're going to commit this into a new 2.x branch?
Might make sense, yeah.
It would make sense to define the results of those functions as variables, to subsequently be able to use a single string for the query (on one line) having the $variables embedded. They also seem to be used in the other query of this update.
Can we rename $query_string to $sql?
Would be nice to use spaces between = assignments in the SQL.
Why don't we use update_sql() here?
Otherwise, the code looks good and ready to be committed. I guess we can deal with any problems in follow-up patches as they arise.
Powered by Dreditor.
Comment #15
keithm commentedRerolled with recommendations.
Comment #16
keithm commentedhttp://drupalcode.org/project/viewfield.git/commit/f5dec34