I enabled the MediaWiki flexifilter that comes with the module on a D7 site. I changed the URL of [[linked]] pages to go to our own server instead of Wikipedia.

I enabled the text filter, but now I get the following error at the top of pages on the site:

Notice: Undefined index: components in flexifilter_filter_prepare() (line 405 of /public_html/sites/all/modules/flexifilter/flexifilter.module).
Warning: Invalid argument supplied for foreach() in flexifilter_invoke_components() (line 322 of /public_html/sites/all/modules/flexifilter/flexifilter.module).
Notice: Undefined index: components in flexifilter_filter_process() (line 415 of /public_html/sites/all/modules/flexifilter/flexifilter.module).
Warning: Invalid argument supplied for foreach() in flexifilter_invoke_components() (line 322 of /public_html/sites/all/modules/flexifilter/flexifilter.module).

I get it when editing a node as well as viewing. I tried changing the order of the text filters, moving the MediaWiki flexifilter from first to last in the processing order, but this has made no difference.

Any ideas what's up?

Thanks!

Al,

CommentFileSizeAuthor
#9 get-components-1262134-5139272.patch1.27 KBsoyarma

Comments

ajaysolutions’s picture

I've since disabled the Mediawiki flexifilter, but today I created my own basic Flexifilter to make tagged keystrokes look better for special characters.

Anyway, when I preview the flexifilter, and test:

<kbd>Enter</kbd>

It works, and correctly identifies the string and replaces "Enter" with "↵ Enter". However, I don't get the same behaviour when editing or viewing a page that uses this code and this flexifilter. I get the same errors above, referring to the same lines (405, 322 and 415) of flexifilter.module.

I presume this is something fundamental with the D7 version of the module?

uwguy’s picture

Just wanted to say I'm seeing this same error using D7, Notice... line 405 and Warning... line 322 as above.

tshakah’s picture

Priority: Normal » Major

Same problem; had hundreds of errors (but basically the same 3 repeated). The preview panel works fine, it's just when a filter is enabled on the input that it gives the errors (and the filter doesn't work).

reecemarsland’s picture

Each of these functions call $filters = flexifilter_get_filters(FALSE);

Which bypasses loading the components, but the filters need the components. Changing the code to:

$filters = flexifilter_get_filters(TRUE);

Appears to fix it.

ajaysolutions’s picture

Nice on ReeceMarsland. Is this included in the beta1 release?

sveloz’s picture

Status: Active » Needs work

I get eccactly the same errors at ajaysolutions. I tried ReeceMarsland's fix in #4, but didn't work for me, after which I get other errors:

Notice: Undefined index: components in flexifilter_filter_process() (line 415 of C:\(...)\sites\all\modules\flexifilter\flexifilter.module).
Warning: Invalid argument supplied for foreach() in flexifilter_invoke_components() (line 322 of C:\(...)\sites\all\modules\flexifilter\flexifilter.module).
Notice: Undefined index: components in flexifilter_filter_process() (line 415 of C:\(...)\sites\all\modules\flexifilter\flexifilter.module).
Warning: Invalid argument supplied for foreach() in flexifilter_invoke_components() (line 322 of C:\(...)\sites\all\modules\flexifilter\flexifilter.module).

Maybe there are some more fundamental debugging required. Because of this error, the module is useless until it is fixed, for those who are affected by it. When I run an preview in admin/structure/flexifilters/4/preview, the output is correct and there are no error. The module only breaks when used through viewing a node.

sveloz’s picture

Status: Needs work » Active
groovehunter’s picture

Would be great to have that fixed; subscribing here; Had a look to check if I can do but it took me quite some time to understand so I have to stop here.

soyarma’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new1.27 KB

This patch will fix the issue. Also, I've contacted Charlie directly to see if there are any unintended consequences. In my testing, after applying the patch things work correctly.

sveloz’s picture

I forgot to update it here. It turned out that the patch did solve the problem on my site, but under some condition that I didn't figure out what was. I installed several input filter modules, and it could've been that some modules don't cooperate, I don't know. I installed and uninstalled different modules on my testsite, and I didn't cope with what I did, but at some point these errors was away when I did the correction in the patch.

tshakah’s picture

I applied the patch and it seems to be working fine as well. Thanks.

hampshire’s picture

Worked great. Thanks

theprecarious’s picture

The patch in #9 worked for me as well. Thanks!

I wonder also if the title of this issue should be changed?

silkogelman’s picture

Patch #9 worked for me too (applied on Flexifilter 7.x-1.0-beta1)
Tested adding a new Flexifilter, and it seems to work fine.

jarodms’s picture

Assigned: Unassigned » jarodms

patch committed.

jarodms’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.