Closed (fixed)
Project:
Field formatter settings
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2012 at 13:54 UTC
Updated:
1 Oct 2012 at 21:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
dave reidYep, this is something I'd like to solve before 7.x-1.0 official release.
Comment #2
henrijs.seso commentedIndeed. Also panels support.
Comment #3
yannickooDave what's going on here? Do you will fix that next time?
Comment #4
spacegoat1701 commentedI've added Views functionality to my installation. Attached is a patch generated by phpStorm.
Please note that this is untested aside from implementing Views integration with my installation of Responsive images and styles 2: http://drupal.org/project/resp_img
Comment #5
yannickooI attached a better version of this patch (can be applied with
git apply field_formatter_settings-views_integration-1439838-5.patch) but after applying the patch and clearing the caches I even don't get the field formatter settings :(Comment #6
tobiasbComment #7
yannickooMy patch is just another version of the patch in #4 so "needs work" is the right status.
Comment #8
yannickoo#5: field_formatter_settings-views_integration-1439838-5.patch queued for re-testing.
Comment #9
spacegoat1701 commentedI've been checking with my own installation, and it's working fine for me on all the Views fields I've checked.
I did tweak the function a bit, though, to prevent some watchdog messages I was receiving:
I'm using Drupal 7.15, Views 7.x-3.3, and Field Formatter Settings 7.x-1.x-dev from June 28, 2011.
If you're using those versions, I don't know why it's not working for you. Maybe try my tweaked function. If that still doesn't work, check your watchdog and server logs for errors; maybe those could help.
I should note that I don't have a lot of time to provide support now. I just wanted to share what I had made work on my own install.
Comment #10
yannickooStrange, have the same versions installed. Could you show me the form the settings and the context variable via:
For plain text field formatter I get following dpm's:

Comment #11
spacegoat1701 commentedFor an image field, dpm($form['options']['settings'], 'settings'); yields (on my setup, the area in which the devel output rendered was too small for a screenshot to be useful, and I couldn't resize):
... (Array, 2 elements)
image_style (Array, 5 elements)
image_link (Array, 5 elements)
dpm($context, 'context'); yields:
... (Array, 5 elements)
module (String, 5 characters ) image
field (Array, 16 elements)
formatter (String, 5 characters ) image
form (Array, 23 elements)
form_state (Array, 27 elements)
For a taxonomy reference field, settings:
... (Array, 5 elements)
textformatter_link (Array, 4 elements)
textformatter_skip (Array, 5 elements)
textformatter_and (Array, 4 elements)
textformatter_period (Array, 4 elements)
textformatter_rdf (Array, 5 elements)
Context:
... (Array, 5 elements)
module (String, 8 characters ) taxonomy
field (Array, 16 elements)
formatter (String, 23 characters ) taxonomy_term_reference
form (Array, 23 elements)
form_state (Array, 27 elements)
Date field, settings:
... (Array, 6 elements)
format_type (Array, 6 elements)
fromto (Array, 6 elements)
multiple_number (Array, 9 elements)
multiple_from (Array, 7 elements)
multiple_to (Array, 8 elements)
show_repeat_rule (Array, 6 elements)
Context:
... (Array, 5 elements)
module (String, 4 characters ) date | (Callback) date();
field (Array, 16 elements)
formatter (String, 8 characters ) datetime
form (Array, 23 elements)
form_state (Array, 27 elements)
Comment #12
yannickooSo I patched views and based on the posted patch #1741216: Views handler doesn't store the field instance in the object, so it's hard to reuse we can patch this module so that we finally have views integration!
Comment #13
yannickooChanged the
_dummyview mode to_customlike in the field_view_field function.Comment #14
yannickoo#1741216: Views handler doesn't store the field instance in the object, so it's hard to reuse is fixed, Dave can you commit the patch?
Comment #15
dave reidTested and committed #13 to 7.x-1.x with some small tweaks (use instanceof rather than get_class(), added docs). Thanks everyone!
http://drupalcode.org/project/field_formatter_settings.git/commit/7c2b0cd
Comment #17
yannickooIt's so sad to reopen this issue but I think you can set the field formatter settings in views but we don't do anything with displaying it correctly right? I don't think that we call
hook_field_attach_view_alter.I got an issue #1799350: Field is empty when displaying via views module with this bug and was confused because we fixed that here but that was only the settings stuff and not the display thing.
Comment #18
yannickooAfter lot of debugging I can confirm that this isn't a Field formatter settings issue. The problem is in
hook_field_attach_view_alter, sorry for reopening.