Forums

array_key_exists() expects parameter 2 to be array error

ljk 22 Jul, 2013
Hi,

I have a Joomla 2.5.11 site using Chronoforms V4 stable. My error_log is filled with the following:

PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/benee/public_html/components/com_chronoforms/chronoforms.php on line 24

Is there any way to fix this issue. I know it is just a warning, but the log file is getting big.

Thank you.
GreyHead 14 Aug, 2013
Hi ljk,

I'm not clear why the notice is raised - it looks as though $this->params ahould be set to an array in the construct function :-(

This hack should block the error though:
function get($k, $v = null){
  // add these three line
  if ( is_null($this->params) ) {
    return false;
  }
  if(array_key_exists($k, $this->params)){
    return $this->params[$k];
  }else{
    return $v;
  }
}
ljk 14 Aug, 2013
Hi,

Thank you for the fix, that seems to have stopped the warnings in the error log.
rijo6920 09 Feb, 2014
Hello,
I am in the process migrating chronoForms from 1.5 to 3.0 joomla. I tried the suggested fix and my form displayed in my website; however, the forms did not appear to have all functionality. The input fields for my form are not displaying properly. I still get the same warning message in the Form Wizard. Has there been an update to chronoForms V4 that corrects this warning message?
GreyHead 09 Feb, 2014
Hi Rijo6920,

You said The input fields for my form are not displaying properly. What does that mean exactly?

I don't know if there has been a fix for the PHP Warning, the simplest solution for that is to set site Error Reporting to System Default or to None in the Site Global Configuration.

Bob
This topic is locked and no more replies can be posted.