When using the Icon API: Filter module, and inserting a tag with a bundle that does not exist (i.e. has not yet been imported) after it can't find the bundle, the module causes a fatal error:
Recoverable fatal error: Argument 1 passed to icon_process_attached() must be an array, boolean given, called in /www/sites/all/modules/icon/modules/icon_filter/icon_filter.module on line 69 and defined in icon_process_attached() (line 383 of /www/sites/all/modules/icon/includes/utilities.inc).
The website encountered an unexpected error. Please try again later.
Attached patch fixes the issue.
To reproduce, enable the Icon API: Filter module and its filter for a text format, then insert a tag in the body content like [icon:some-false-bundle-that-does-not-exist:%icon] and attempt to view the processed result.
Comments
Comment #1
Rory commentedComment #2
mariacha1 commentedPatch applies cleanly and solves the problem mentioned.
Comment #3
markhalliwellA much clearer approach would be:
Comment #4
kyletaylored commentedre-rolled with suggestion.
Comment #5
mariacha1 commentedSmall, change, you're repeating a line of code unnecessarily here:
Should be:
The original $bundle = icon_bundle_load($match[1]); can come out, since that's in the if statement as well.
Comment #6
kyletaylored commentedYou can always just re-roll the patch.
Comment #7
mariacha1 commentedLooks good to me!
Comment #8
klonosComment #9
klonos...adding the error message to the issue summary (and part of it in the issue title) so that people can find this issue easier when searching by error text.
#6 fixes this. Thanx @kyletaylored!!!
Comment #10
klonos...missed a space there. Sorry for the noise.
Comment #11
markhalliwellAdding it to the issue summary is enough (it will be picked up in search). Changing the title back for legibility and preventing unnecessarily long issue table rows.
Comment #12
markhalliwell