Support » Plugins » [cforms] Fatal error when activating Cforms (11.7.1, 12.2)

  • When I try to activate Cforms I get this fatal error:

    Fatal error: Cannot use string offset as an array in /home/[…]/wp-content/plugins/cforms/lib_activate.php on line 7

    I got the same error both in version 11.7.1 and 12.2 (last one), both in WP 3.2.1 and WP 3.3 beta 3.

    These are the lines starting with line 7:

    $cformsSettings['global']['plugindir'] = basename(dirname(__FILE__));
    $cformsSettings['global']['cforms_root'] = get_cf_plugindir() . $cformsSettings['global']['plugindir'];
    $cformsSettings['global']['tinyURI'] = get_option('siteurl') . '/wp-includes/js/tinymce';
    $cformsSettings['global']['cforms_root_dir'] = dirname(__FILE__);
    $cformsSettings['global']['cforms_IIS'] = strpos(dirname(__FILE__), '\\') !==false ? '\\' : '/';
    $cformsSettings['global']['v'] = $localversion;

    Does anyone have an idea about how to fix this? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Meanwhile I found a temporary solution here:

    seams to be that the $cformsSettings is not declared as an array, but understood as the string instead.

    if you put:

    $cformsSettings = array();

    right behind the row with:

    global $wpdb, $cformsSettings;

    in lib_activate.php it will fix it.

    the better way would be to type cast, as it is a global variable

    $cformsSettings = (array) $cformsSettings;

    However, this is a bandaid to a deeper problem. And actually this gets rid of the error, but does not explain or help why your settings array is not being read correctly (which is my issue) and by doing this type casing it prevents me from reading the settings array correctly (meaning my forms have all disappeared)

    I do not have an answer to this issue, sorry as I am still having it

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[cforms] Fatal error when activating Cforms (11.7.1, 12.2)’ is closed to new replies.