Closed (fixed)
Project:
Custom filter
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2007 at 16:29 UTC
Updated:
15 Jul 2009 at 15:10 UTC
Hi,
Thanks for the module, seems to be a good idea...
When I'm using it, I get an error
warning: Invalid argument supplied for foreach() in C:\wamp\www\panels10\sites\all\modules\customfilter\customfilter.module(1004) : runtime-created function on line 5.
Comments
Comment #1
arhip commentedHi. May I know when the error raised? It seems the error is in the filter (runtime created function), not the module. Can you attach the filter being used? And the sample input of course.
Thanks.
Comment #2
arhip commentedThe error raises because of TOC filter, it has a line like this (line 5):
When there is no heading at all, this line will raise an error, since $vars->headings doesn't have value. Solution, you can change the TOC filter replacement code with this:
Difference is, the new code checks first if there is array named $vars->headings, and check whether this array contains at least one element (the real MediaWiki will generate TOC when headings >= 4).
Comment #3
avpadernoThe reported code comes from the filter sample that can be imported from customfilter_sample.xml. It's a sample filter that can be modified from the user, and it is given only like example of filters that can be created with this module.
I am setting the report as fixed because it got an answer.