I have a few Jquery Colorpicker fields added to node, with some label, default value, required flag, etc.
But on node edit form, fields doesn't respect my settings (label 'Color', no default value, no required)
Also on Manage Display page, I can see following error:
Notice: Undefined index: field types in field_ui_formatter_options() (line 1451 of .../modules/field_ui/field_ui.admin.inc).
Warning: Invalid argument supplied for foreach() in field_ui_formatter_options() (line 1451 of .../modules/field_ui/field_ui.admin.inc).
Comments
Comment #1
jaypanPlease show me some of the code you are using. Without that I can't replicate your issue.
Comment #2
zakjan commentedI don't have any special code for this.. it is just D7 Field attached via Field UI to content type Webform.
Comment #3
jaypanEven that much helps. Without some kind of information about the environment in which it is being used, it's almost impossible to debug.
Comment #4
chrisgross commentedI'm having this same problem on D7 / Zen subtheme. The picker works, but as a field, not so much. Default settings do not stick, and I get the same error in manage displays. Is it required to add that PHP code in addition to just adding a field to a content type?
Comment #5
jaypanNo, it's not supposed to be.
Sorry about the hassles guys. When I get a chance I'll sit down and try to replicate and fix the problem. I think I must have missed a necessary hook. There unfortunately isn't a lot of documentation on this topic yet, so it's still trial and error at the moment.
Comment #6
zakjan commentedFixed, it was easy.
Comment #7
zakjan commentedComment #8
chrisgross commentedIs the second patch an updated version of the first? Why are there two?
Comment #9
zakjan commentedYes, second is updated.
Comment #10
johnkennedy commentedThanks for that #7
Comment #11
anton-staroverov commentedThanks for the patch #7, worked for me.
But I found a nasty bug. If you enter multiple values in one field, they will not display correctly. All of them will have the color of the last value. The error is in these lines: 322, 326 (function jquery_colorpicker_field_formatter_view)
My fix:
Comment #12
muschpusch commented@zakjan: your patch was patching the jquery_colorpicker.new.module instead of jquery_colorpicker.module file. I changed that! It seems to fix the issue :) changing status
@tonystar: this is a new issue and actually the solution i was looking for. Thanks! I will attach a patch here #1149120: Multiple colored divs get same class
Comment #13
plopescHello
Thank you very much for your help.
I tested your patch and committed your changes.
Regards