Closed (duplicate)
Project:
Wysiwyg
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 May 2012 at 12:40 UTC
Updated:
8 Oct 2012 at 12:26 UTC
On some reason I ave this notice on my site:
Notice: Undefined variable: format_id in /home/elias/sites/otpusk.ru/sites/all/modules/wysiwyg/wysiwyg.module on line 211
I think on this place should be $format_field['#id'] (or maybe $format_field['format']['#id'])
| Comment | File | Size | Author |
|---|---|---|---|
| wysiwyg.patch | 561 bytes | istankevych |
Comments
Comment #1
twodThat variable is defined on line 178:
It's not the id of the field, but the id of the formats allowed for that field: for example
$format_field['format']['#options']['filtered_html'].Have you changed anything in wysiwyg.module or applied any patch which might have?
Please remove sites/all/modules/wysiwyg and extract the 7.x-2.1 version of the module there again (no need to uninstall/reinstall) and try again.
Comment #2
panuv commentedLine 211 is out-of-scope for the foreach ($format_id set on 178). If there's no ['format']['#options'], then this is unset. (and if there is, it is taking the last $format_id). And it's the fallback to the situation where user cannot set the comment format himself.
One suggestion: to use
filter_fallback_format()?Comment #3
panuv commentedComment #4
twodA couple of patches got in so the line numbers are different now.
$format_idis now set on 194 and used on 205 and posibly 227, depending on whether the user has access to the format selector or not.['format']['#options']should always be set since if the user has access to only one format, it should still be in the list of allowed formats.Anyway, we've got a patch to simplify this in #934976: Provide method to hide input format fields without disabling WYSIWYG so I'll mark this as a duplicate. Please follow that issue to know when the patch gets in (and verify it actually fixes the issue for you).