• Resolved Scabbard

    (@scabbard)


    I upgraded to 2.3 on my site yesterday and after the upgrade my site crashed. All I would get is this “PHP Parse error, unexpected T_FUNCTION, expecting ‘)’……………………/wp-content/plugins/woocommerce-mutilingual/woocommerce_wpml.class.php on line 423

    Any idea how to fix this. I’m afraid to try again as I don’t want my site to crash again.

    *I did upgrade WPML at the same time……..

    https://www.ads-software.com/extend/plugins/woocommerce-multilingual/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    I got the same error too. Syntax error, but I
    do not know how to fix it.

    This is line 423:
    $email_actions = array_merge($email_actions,array_map(function($val) {return $val.'_notification';},$email_actions));

    Preceding lines, 397 to 422 … just in case one needs the previous codes to check line 423:

    function email_footer() {
            global $sitepress;
    
            $sitepress->switch_lang();
        }
    
    	function translate_email_notifications() {
    		$email_actions = array( //the first ones worked for WC 1.6
    			'woocommerce_order_status_pending_to_processing',
    			'woocommerce_order_status_pending_to_completed',
    			'woocommerce_order_status_pending_to_on-hold',
    			'woocommerce_order_status_failed_to_processing',
    			'woocommerce_order_status_failed_to_completed',
    			'woocommerce_order_status_pending_to_processing',
    			'woocommerce_order_status_pending_to_on-hold',
    			'woocommerce_order_status_completed',
    			//next are new, at least since WC 2.04; they also began to add the postfix '_notification'
    			//not clear they are consistent accross versions between 2.0 and 2.0.8, so adding them without postfix as well
    			'woocommerce_new_customer_note',
    			'woocommerce_reset_password',
    			/* the following are not added because messages to admins should not switch language; left here for reference of other _notification actions
    			'woocommerce_low_stock',
    			'woocommerce_no_stock',
    			'woocommerce_product_on_backorder'*/
    		);
    		//added for WC 2.0.x

    Plugin Author David Garcia Watkins

    (@dgwatkins)

    Dear users,

    We accidentally introduced a closure, which doesnt work until PHP 5.3. You must be using PHP 5.2. This is fixed already in our development version:

    https://downloads.www.ads-software.com/plugin/woocommerce-multilingual.zip

    Thank you for your reply. I upgraded to PHP5.3. All is ok now.

    Thanks again.

    Thread Starter Scabbard

    (@scabbard)

    Is the development version safe to install on my site?

    Plugin Author David Garcia Watkins

    (@dgwatkins)

    The only change made since 2.3 is this one. Its safe.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Parse error after upgrading to 2.3’ is closed to new replies.