Author:
community
Version:
1.4
Released:
4 March 2011
Category:
Events, and Third Party Integration

Closed#1: Unable to create/edit an event if "Akismet Spam Filtering" is not selected

The following warning appears every time I try to create or edit an event from the backend, when the “Akismet Spam Filtering” filter rule is not selected:

in_array() expects parameter 2 to be array, null given /home/cybe/Documenti/Web/lineheight/extensions/akismet/extension.driver.php line 76

71          $context['wrapper']->appendChild($group);
72                      
73      }
74      
75      public function addFilterDocumentationToEvent($context){
76          if(!in_array('akismet', $context['selected'])) return;
77          
78          $context['documentation'][] = new XMLElement('h3', 'Akismet Spam Filtering');
79          
80          $context['documentation'][] = new XMLElement('p', 'Each entry will be passed to the Akismet Spam filtering service before saving. Should it

Mhhh, actually I think that happens only if none of the filter rules are selected at all. Can you confirm?

Solved replacing line #76:

if(!in_array('akismet', $context['selected'])) return;

with:

if(is_array($context['selected']) && !in_array('akismet', $context['selected'])) return;

This sounds about right. Newer versions of Symphony are less forgiving with these types of errors. In previous versions these would be silently logged in the /manifest/logs folder, but now they correctly throw errors. The “is_array” problem has occurred quite a lot, but I guess there are still a handful of extensions which exhibit the problem that need to be patched.

If you have the ability to, please fork on Github and send Alistair a pull request.

If you have the ability to, please fork on Github and send Alistair a pull request.

If you have the ability to, please fork on Github and send Alistair a pull request.

Done: http://github.com/eKoeS/akismet/commit/5a2556be41b0a976e6c3c5240f5d88958a01a292

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details