I've got Editable fields installed in order to allows my users to edit content in a table created by Views. Everything seemed to be working just fine until today. I installed Node Option Premium to see if it would help me achieve a different goal and started to get the following notices whenever a non-authenticated user tries to access 'Premium' content:
Notice: Undefined index: module in editablefields_fallback_formatter() (line 173 of C:\wamp\www\drupal-7.7\sites\all\modules\editablefields\editablefields.module).
Notice: Undefined index: module in _field_info_prepare_instance_display() (line 350 of C:\wamp\www\drupal-7.7\modules\field\field.info.inc).
Notice: Undefined index: module in editablefields_fallback_formatter() (line 173 of C:\wamp\www\drupal-7.7\sites\all\modules\editablefields\editablefields.module).
Notice: Undefined index: module in _field_info_prepare_instance_display() (line 350 of C:\wamp\www\drupal-7.7\modules\field\field.info.inc).
Now this is for an entirely separate content type than the one I'm using Editable Fields on, and as far as I'm concerned, Editable Fields should have nothing to do with this new content type: I've checked the Manage Display tab for the content type in question, and all of the fields are at their default settings - none of them are set to Editable.
I came across a few posts about the _field_info_prepare_instance_display() notice, but nothing for the editablefields_fallback_formatter() one so I don't really know where to go from here.
Any ideas?
I'm going to have a quick bash with the dev release, see if this makes any difference.
Comment | File | Size | Author |
---|---|---|---|
#31 | Selection_140.png | 12.57 KB | sumthief |
#31 | editablefields-undefined_index-1233688-30.patch | 1.11 KB | sumthief |
#20 | editablefields.undefined-index.1233688-20.patch | 712 bytes | Kristen Pol |
#8 | 1233688-empty_text-empty-vs-isset.patch | 873 bytes | bradjones1 |
#3 | Screen shot 2011-10-24 at 1.15.21 PM.png | 69.28 KB | rlnunez |
Comments
Comment #1
carl.brown CreditAttribution: carl.brown commentedOK, hang on...
None of the fields in 'Manage Display' for the default display were set to Editable, but two of the fields for the Teaser display were (I'm going to assume that this happened by default, if only to save a little face) - and Node Option Premium only shows teasers of 'premium' content to non-authenticated users.
So it's something about permissions and editable teasers, perhaps...
I can't image anyone would want to allow non-authenticated users to edit fields for premium content and therefore I think you can assume this isn't too big a deal ;)
Comment #2
rlnunez CreditAttribution: rlnunez commentedI had the same issue too and discovered that you have to put something into the "empty text" area in the editablefield's settings under Manage Display.
Comment #3
rlnunez CreditAttribution: rlnunez commentedscreenshot attached
Comment #4
BeaPower CreditAttribution: BeaPower commentedi get this error like this:
Notice: Undefined index: module in editablefields_fallback_formatter() (line 173 of C:\xampp\htdocs\b2011\sites\all\modules\editablefields\editablefields.module).
Notice: Undefined index: module in _field_info_prepare_instance_display() (line 350 of C:\xampp\htdocs\b2011\modules\field\field.info.inc).
Notice: Undefined index: module in editablefields_fallback_formatter() (line 173 of C:\xampp\htdocs\b2011\sites\all\modules\editablefields\editablefields.module).
Notice: Undefined index: module in _field_info_prepare_instance_display() (line 350 of C:\xampp\htdocs\b2011\modules\field\field.info.inc).
SearchApiException: No field settings for index with id default_node_index. in SearchApiDbService->indexItems() (line 314 of C:\xampp\htdocs\b2011\sites\all\modules\search_api_db\service.inc).
Comment #5
frixos12 CreditAttribution: frixos12 commentedsubscribing
Comment #6
johnvI thkn this happens when I disable a module which has formatters set in Fields or Views. When the formatter has become disabled, the Editable formatter is the first one,instead of the Default one that most modules offer.
Comment #7
johnvThe error happens with more modules, when they are enabled, disabled.
I have added the following to the code to find the wrong formatter.
After saving the mentioned field settings, the message no more appears.
Comment #8
bradjones1I think the problem is more along the lines of #2 - if you insert something -- anything -- into the empty_text field, "it works."
Since the suggested fix worked for me quickly, I didn't spend a whole lot of time looking into this, but I think the attached patch gets at the real culprit. In editablefields_lazy_render_fields() there's an !empty() on the empty_text configuration, and I'm guessing it should be isset(). This didn't introduce a regression, though it could use review on a new install.
Comment #9
HansKuiters CreditAttribution: HansKuiters commentedI had the same messages and had a go with the current dev. My conclusion: it's a permissions thing. Both inserting something into the empty_text field or applying the patch from #8 didn't do it for me. Setting permissions to edit the content type solved it for me.
So what needs to be done is check for node edit permissons (if that is possible by this module) or display a nice message if editable fields are not present. But if you want one to only edit your editable field and not the other node fields, there should be a more differentiated permission scheme.
Comment #10
ablondeau CreditAttribution: ablondeau commentedI think that the source of the issue is that editablefields_field_formatter_info has
'fallback_format' => NULL,
So, later when editablefields_fallback_formatter tries to get the default format, there is nothing there. Setting fallback_format to 'text_default' clears up the issue for me but may cause side effects that I haven't discovered yet.
'fallback_format' => 'text_default',
Comment #11
Grimtech-1 CreditAttribution: Grimtech-1 commentedSame issue here.
Successfully worked around by adding some text to the empty_text field.
Comment #12
stevep CreditAttribution: stevep commented#2 worked for me as well. Thanks for posting and thanks for this great module
btw, #2 initially didin't work for me: after filling the empty text box and running cron I had 4 pages of the same errors. I had to clear cache a few times, now fine.
Comment #13
devenpro CreditAttribution: devenpro commented#8 Patch is working fine and message disappeared as soon as i patched and reloaded the page.
Thx for your effort and sharing.
Comment #14
MGParisi CreditAttribution: MGParisi commentedTested
Comment #15
dmadruga CreditAttribution: dmadruga commented#8 didn't work for me.
I also tried #2 and #2 + #8 without success.
The only workaround that seems to work for is is checking if "$formatter_type['module']" is set in function editablefields_fallback_formatter:
Comment #16
emcniece CreditAttribution: emcniece commentedI concur with the "Edit Content Type" permission issue - admins with the permission do not see the error (and can edit the field) while anonymous users see the error. Solutions #2 and #8 failed for me as well - #15 did the trick however.
Comment #17
Yuri CreditAttribution: Yuri commented#15 indeed worked. Ready to commit a new version?
Comment #18
MGParisi CreditAttribution: MGParisi commentedMight want to change set the status
Comment #19
bradjones1Needs to be an actual patch file.
Comment #20
Kristen Pol#15 works for me. Here's a patch.
Comment #21
dags CreditAttribution: dags commentedI'm thinking we want to return something other than NULL here. From the API docs, field_info_formatter_types() returns "Either a single formatter type description, as provided by hook_field_formatter_info(), or an array of all existing formatter types, keyed by formatter type name." Will take a closer look at this
later today...when I have a chance.Comment #22
FATALIST CreditAttribution: FATALIST commenteddel.
Comment #23
OnkelTem CreditAttribution: OnkelTem commentedPlease try the patch provided in #1275924-7: Notice: Undefined index: default_formatter in editablefields_field_formatter_default_settings() with 'Media Field' and tell if it fixes the issue.
Comment #24
charlie-s CreditAttribution: charlie-s commentedApplying #15 here + https://drupal.org/comment/8252581#comment-8252581 resolved the issue for me.
Comment #25
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedPatch #20 manually worked for me. Did not need the other one mentioned. Thank you.
Comment #26
benjarlett CreditAttribution: benjarlett commentedPatch #20 manually worked for me too.
Comment #27
Alauddin CreditAttribution: Alauddin commentedpatch from #20 works.
Comment #28
joelpittet@dags, could I get your thoughts on the return NULL return value from #21?
Comment #29
joelstein CreditAttribution: joelstein as a volunteer commented#20 works for me.
Comment #30
joelpittetI'm all for fixing notices, but I'd like to provide more info to why it's missing to the user instead of just bailing.
'module'
key should always exist, in what case does it not?This is the line the adds it I believe in core:
modules/field/field.info.inc:221
Comment #31
sumthief CreditAttribution: sumthief as a volunteer and at DrupalJedi commentedHello @joelpittet,
Looks like problem somewhere around field module.
If you'll change actual formatter for the field and if there is exists settings form for the formatter you have to open formatter settings form to save formatter settings (Please see attachment). Otherwise field module won't save even default formatter settings.
Also looks like patch from #20 was commited in dev version. I think that even this patch works good it would be better to solve this problem as it done for the formatter settings form (see editablefields_field_formatter_settings_form() function - via default formatter settings). I attach patch which reflects my vision.
Comment #32
oadaeh CreditAttribution: oadaeh at Hook 42 for Zicasso, Inc. commentedThe patch in #20 was committed (most likely accidentally) in this commit, which was for #2753349: Prevent huge cache form table.