WordPress.org

Ready to get started?Download WordPress

Forums

[cforms] Fatal error when activating Cforms (11.7.1, 12.2) (3 posts)

  1. conualfy
    Member
    Posted 2 years ago #

    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!

  2. conualfy
    Member
    Posted 2 years ago #

    Meanwhile I found a temporary solution here:
    http://www.deliciousdays.com/cforms-forum/troubleshooting/i-got-a-fatal-error-when-installing/

    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.

  3. glideranderson
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic