Complete message shown :
Notice: Undefined index: 3 in filter_list_format() (line 675 of /.../modules/filter/filter.module).
Warning: Invalid argument supplied for foreach() in filter_list_format() (line 675 of /.../modules/filter/filter.module).
This results because my `filter` SQL table is as follows:
+--------+--------+----------------------+--------+--------+----------+
| format | module | name | weight | status | settings |
+--------+--------+----------------------+--------+--------+----------+
| 1 | filter | filter_autop | 2 | 1 | a:0:{} |
| 1 | filter | filter_html | 1 | 1 | a:0:{} |
| 1 | filter | filter_htmlcorrector | 10 | 1 | a:0:{} |
| 1 | filter | filter_url | 0 | 1 | a:0:{} |
| 2 | filter | filter_autop | 1 | 1 | a:0:{} |
| 2 | filter | filter_htmlcorrector | 10 | 1 | a:0:{} |
| 2 | filter | filter_url | 0 | 1 | a:0:{} |
| 4 | filter | filter_autop | 2 | 1 | a:0:{} |
| 4 | filter | filter_html_escape | 0 | 1 | a:0:{} |
| 4 | filter | filter_url | 1 | 1 | a:0:{} |
+--------+--------+----------------------+--------+--------+----------+
10 rows in set (0.00 sec)
format #3 exists, but doesn't have any filters applied, and filter module doesn't like it.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | filter_fix-1067998-7.patch | 984 bytes | amanaplan |
| #8 | filter_fix-1067998-8.patch | 976 bytes | eporama |
Comments
Comment #1
ceefour commentedFix, change around line 675 in filters.module :
...
if (!isset($filters[$format_id])) {
$format_filters = array();
foreach ($filters['all'][$format_id] as $name => $filter) {
...
to :
...
if (!isset($filters[$format_id])) {
$format_filters = array();
$filter_map = isset($filters['all'][$format_id]) ? $filters['all'][$format_id] : array();
foreach ($filter_map as $name => $filter) {
...
Comment #2
ceefour commentedComment #3
greenskin commentedI believe this belongs here.
Comment #4
alexkb commentedI also had this issue right after doing an upgrade from Drupal 6.20 to 7.0. The patch fixed my problem, thanks ceefour.
Comment #5
Starminder commentedhad the same issue, patch above fixes it. please commit.
Comment #6
damien tournoud commentedI have seen that too... but there is no patch in this issue :)
Comment #7
Starminder commented:) ok ok - I just mean the little fix in comment #1.
Comment #8
eporama commentedHere's a patch for the fix in comment #1 so we can have it tested and reviewed.
Comment #9
bryancasler commentedPatch #8 worked for me. I had a duplicate issue being worked on over here #1184186: Warning: Invalid argument supplied for foreach() in filter_list_format() (line 674
Comment #10
NickLitten commentedGreat stuff. Patch #8 fixed the problem (filter errors after updating a node) for me on Droop7.2
Cheers!
Comment #11
amanaplan commentedWorked for me. RTBC-ing.
Comment #12
amanaplan commentedAdding tag so that we remember it has to be backported to Drupal 7 to be applied to the 7.x-dev branch.
Comment #13
Mesut58 commentedit worked thank you
Comment #14
bryancasler commentedSince Patch #8 worked on D7, what's preventing it from being committed?
Comment #15
amanaplan commentedHere's the patch in comment #8 backported for D7.
Comment #16
amanaplan commentedForgot to attach. Here's the patch in comment #8 backported for D7.
Comment #17
tlangston commentedthank you - worked here too
Comment #18
tlangston commentedthank you - worked here too
Comment #19
catchTagging for backport.
Comment #20
amanaplan commentedIt already has a patch for D7.
Comment #21
tlangston commentedIf so, amanaplan, I shouldn't see the issue recur when I upgrade to 7.7. But I do. Are you saying the patch is in dev?
Comment #22
webchickCommitted and pushed to 8.x and 7.x. Thanks!