• Resolved Nazar Hotsa

    (@bugnumber9)


    Hello,

    I’m following the official documentation: https://wpml.org/documentation/related-projects/woocommerce-multilingual/ so I installed and activated WooCommerce, WPML String Translation and WPML Translation Management plugins (in this exact order).

    WPML and WPML Media Translation were already active on the site.
    Now I install WooCommerce Multilingual, try to activate it and get error 500.
    The error log contains this:
    [21-Mar-2016 13:42:34 UTC] PHP Fatal error: Cannot redeclare _wpml_api_allowed_content_type() (previously declared in /wp-content/plugins/sitepress-multilingual-cms/inc/wpml-api.php:25) in /wp-content/plugins/sitepress-multilingual-cms/inc/wpml-api.php on line 34

    Any ideas? Am I doing anything wrong?

    https://wordpress.org/plugins/woocommerce-multilingual/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello, the error that you are reporting looks to me like some corruption of the files that you have of our plugins.
    Please get a fresh copy of our latest files and update your plugins.
    The error that you are receiving is indicative of the same function being in two places in the above-mentioned file – on line 25 and on line 34.

    Thread Starter Nazar Hotsa

    (@bugnumber9)

    Hi.
    I did that yesterday and did that again today to confirm.
    I got all latest versions of plugins, re-uploaded files twice (in zip archive and one by one) to make sure nothing gets broken during upload.

    The error is still there when I try to activate WooCommerce Multilingual.
    And no, _wpml_api_allowed_content_type() isn’t declared twice in wpml-api.php, here’re lines 25-34:

    function _wpml_api_allowed_content_type($content_type){
        $reserved_types = array(
            'post'      => 1,
            'page'      => 1,
            'tax_post_tag'       => 1,
            'tax_category'  => 1,
            'comment'   => 1
        );
        return !isset($reserved_types[$content_type]) && preg_match('#([a-z0-9_\-])#i', $content_type);
    }

    We need to debug this further.
    Would you mind to open a new ticket in our forum at wpml.org?
    In that forum, after a supporter enables a private reply, you could share access details, and then we could investigate this further.
    For now, I can only guess at the reason – I don’t have enough information.

    Please verify that you are using:
    Wordpress 4.4.2
    WPML 3.3.6
    WPML String Translation 2.3.6.1
    WPML Translation Management 2.1.5
    WPML Media 2.1.19

    You might also want to switch to a default theme like TwentySixteen and try to disable all other plugins, except WooCommerce, WooCommerce Multilingual and WPML plugins that I mentioned above and test again.

    Thread Starter Nazar Hotsa

    (@bugnumber9)

    Alrighty, looks like I found the root cause.

    The conflict happens with Unyson framework.

    With Unyson deactivated I was able to activate WooCommerce Multilingual, and when I tried to reactivate Unyson – here we go:

    PHP Notice:  Constant WPML_LOAD_API_SUPPORT already defined in wp-content/plugins/unyson/framework/extensions/events/extensions/events-tags/hooks.php on line 7
    PHP Fatal error:  Cannot redeclare _wpml_api_allowed_content_type() (previously declared in wp-content/plugins/sitepress-multilingual-cms/inc/wpml-api.php:25) in wp-content/plugins/sitepress-multilingual-cms/inc/wpml-api.php on line 34

    Looking at hooks.php we have this:

    if ( class_exists( 'SitePress' ) ) {
    	if ( ! defined( 'WPML_LOAD_API_SUPPORT' && defined( 'ICL_PLUGIN_PATH' ) ) ) {
    		define( 'WPML_LOAD_API_SUPPORT', 1 );
    		require ICL_PLUGIN_PATH . '/inc/wpml-api.php';
    	}
    }

    Error reporting in PHP sometimes drives me mad πŸ˜€

    Hello,
    I tested the latest version of Unysion framework and in the file hooks.php I cannot find that code that you are mentioning here.
    Perhaps you or your theme author added this code.

    I would suggest you to give a try to updated version of that framework.

    Thread Starter Nazar Hotsa

    (@bugnumber9)

    Hello,
    I use the latest version of Unyson – 2.5.0
    In order to reproduce the error you also need to have Events extension installed and activated. I had to be more specific about this, sorry.

    The error originates from unyson/framework/extensions/events/extensions/events-tags/hooks.php file, it’s not a part of Unyson ‘core’, but belongs to Events extension for Unyson.

    Thank you for the clarification.
    I talked with our compatibility team. Currently, the author is not responding to our queries.
    Perhaps it would be a good thing if you attempt to contact him as well.

    Thread Starter Nazar Hotsa

    (@bugnumber9)

    I’ll try to as well, thanks.

    Hello, I am not opening a new support issue cause I am seeing the same error. When I activate the plugin I am getting 500 error page but only for a few pages on my WordPress panel *(like plugins page). My website on front-end still works.

    I am seeing those errors:

    Warning: Missing argument 4 for WPML_Term_Language_Synchronization::__construct(), called in /wp-content/plugins/sitepress-multilingual-cms.3.3.5/sitepress.class.php on line 4577 and defined in /sitepress-multilingual-cms.3.3.5/classes/class-wpml-term-language-synchronization.php on line 32

    Fatal error: Call to a member function prepare() on a non-object in /sitepress-multilingual-cms.3.3.5/classes/class-wpml-term-language-synchronization.php on line 168

    Best regards

    Hello @masterjuan,
    Please open a new ticket in wpml.org.
    Before that, I see that you might be using WPML 3.3.5
    I would recommend you to update to WPML 3.3.6

    Please remember to backup your files and database first before you proceed! You can use a plugin for this if you like (example: http://wordpress.org/plugins/duplicator/)

    hello, I had made the update to 3.3.6 via ftp so the directory stayed as it was before sitepress-multilingual-cms.3.3.5/ that’s way you see the version 3.3.5. However the files are from the latest version 3.3.6.

    Could be this a problem?

    @masterjuan, having the wrong name on the directory should not be a problem.

    Since you are reporting a problem with WPML, and this is a forum dedicated to WooCommerce Multilingual, may I kindly ask you to open a new ticket in our forum at wpml.org where our supporters can investigate the issue further?

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Fatal error on activation’ is closed to new replies.