Please refer to TemplateMonster Support for any issues surrounding TemplateMonster/TemplateTuning Themes – thanks, Jigoshop Team

Fatal Error when I try to activate the Catalog Deluxe plugin

Christine's Avatar

Christine

09 Aug, 2012 06:25 PM

I set up a test WP site to test out this plugin after purchasing it. After I've uploaded the plugin and hit the "Activate Plugin" button, my site reloads to show this error message on every page:

"Fatal error: Cannot redeclare of_sanitize_textarea() (previously declared in /nfs/c04/h01/mnt/60062/domains/indexmedia.ca/html/html/christinetest/wp-content/plugins/jigoshop-catalog-deluxe/CatalogDeluxe/classes/admin/sanitize.php:9) in /nfs/c04/h01/mnt/60062/domains/indexmedia.ca/html/html/christinetest/wp-content/plugins/options-framework/options-sanitize.php on line 13"

I had to go in and manually delete the plugin in order to get my WP site to work again. Am I installing the plugin incorrectly? Can you tell me how to fix this problem?

  1. Support Staff 2 Posted by chriscct7 on 09 Aug, 2012 11:15 PM

    chriscct7's Avatar

    Hi,
    The plugin is incompatible with your theme, because both your theme and the plugin use the same name for a function. You need to contact either/both the plugin author and the theme author and have one of them rename the the "sanitize_textarea() function.

    -Chris

  2. 3 Posted by Matt on 10 Aug, 2012 12:35 PM

    Matt's Avatar

    Chris is right, simply rename that function in either plugin or theme to have it working again. The error message shows you what file and line you have to change it on.

    Cheers

  3. 4 Posted by Christine on 10 Aug, 2012 12:57 PM

    Christine's Avatar

    OH! It's right there in the error, I missed the plugin that's causing the conflict, apparently Options Framework must use the same declaration. Since the Catalog plugin has fewer files involved, if I just rename the problem declaration in all the places I find it, will that let the plugin still work? Like I rename any instance of "sanitize_textarea" to "sanitize_textarea_fix" ?

    Thanks for your help, Chris and Matt :)

  4. 5 Posted by Matt on 10 Aug, 2012 01:03 PM

    Matt's Avatar

    I would just rename the of_ prefix of the Catalog Deluxe declarations.

  5. 6 Posted by Christine on 10 Aug, 2012 01:12 PM

    Christine's Avatar

    Apologies, you're going to have to explain a little more explicitly what you mean, as I am a HTML/CSS web designer rather than a PHP developer type, are we talking about editting the "sanitize.php" file?

    Can you copy and paste what part I should be editting?

  6. 7 Posted by Christine on 13 Aug, 2012 03:14 PM

    Christine's Avatar

    r/s if you could please respond, thank you :)

  7. Support Staff 8 Posted by chriscct7 on 13 Aug, 2012 03:28 PM

    chriscct7's Avatar

    You need to go through every file in the plugin and change every name and mention of that function to something else,

    -Chris

  8. 9 Posted by Christine on 13 Aug, 2012 07:29 PM

    Christine's Avatar

    I ended up having to replace two or three other declarations, this is what my sanitize.php ended up looking like:

    <?php

    / Text /

    add_filter( 'of_sanitize_text', 'sanitize_text_field' );

    / Textarea /

    function of_sanitize_textarea2($input) {

    global $allowedposttags;
    $output = wp_kses( $input, $allowedposttags);
    return $output;
    

    }

    add_filter( 'of_sanitize_textarea2', 'of_sanitize_textarea2' );

    / Select /

    add_filter( 'of_sanitize_select', 'of_sanitize_enum2', 10, 2);

    / Radio /

    add_filter( 'of_sanitize_radio', 'of_sanitize_enum2', 10, 2);

    / Checkbox /

    function of_sanitize_checkbox2( $input ) {

    if ( $input ) {
        $output = '1';
    } else {
        $output = '0';
    }
    return $output;
    

    } add_filter( 'of_sanitize_checkbox2', 'of_sanitize_checkbox2' );

    / Check that the key value sent is valid /

    function of_sanitize_enum2( $input, $option ) {

    $output = '';
    if ( array_key_exists( $input, $option['options'] ) ) {
        $output = $input;
    }
    return $output;
    

    }

    It didn't appear that these declarations are named in any of the other files, so just changing whatever I added a 2 to the end of the name, that sound allow you to use Options Framework and the Catalog Deluxe plugin.

    Thanks for your assistance.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.