[PATCHED]Woocommerce - Missing argument warning on WP login - temp fix

Locked
User avatar
kaspir
Moderator
Moderator
Posts: 88
Joined: Mon Mar 20, 2017 2:38 pm
Location: USA
Contact:

[PATCHED]Woocommerce - Missing argument warning on WP login - temp fix

Post by kaspir »

Are you getting an error like this when you log in WordPress, and you have install Woocommerce?

Image

There is a quick fix Alessio found and gave me. We shall edit the /wp-content/plugins/woocommerce/includes/wc-core-functions.php

Find on line #1551:

Code: Select all

function wc_maybe_store_user_agent( $user_login, $user ) {
And change to:

Code: Select all

function wc_maybe_store_user_agent( $user_login, $user = '' ) {
Save & upload.

WARNING: If you update Woocommerce plugin, your edit will be overwritten more than likely. But I'm sure Allesio will have it patched in no time from w3all plugin and thereafter, YOU SHOULD REVERT THIS CHANGE!


Happy coding. :geek:
Image
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads. :P
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Woocommerce - Missing argument error on WP login

Post by axew3 »

Just over to setup and complete the new release, so looking about reports and looking for issues.
So, after added option for WP shortcode about phpBB posts, formatted and displayed into WP posts,
i've return over the issue:

Code: Select all

PHP Warning:  Missing argument 2 for wc_maybe_store_user_agent() in /wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 1551

Woocommerce warning on WordPress login

normally, you'll may never will be noticed about this php warning, because online environments quite often (+-ever) are suppressing php errors and warnings, so you should note it only on php error logs file ...

It return warning issue not only with wp_w3all plugin, it return the same warning on several plugins.
This not mean nothing by he way.

EDITED: after lunch and a walk
Found where and why the error come out:
on class.wp.w3all-phpbb.php
inside:

Code: Select all

phpBB_user_session_set($wp_user_data){
this code (that if you remove avoid the warning to be thrown):

Code: Select all

  $current_user = wp_get_current_user(); 
     //if( $current_user->ID == 0 && !is_multisite() ){
     	if( $current_user->ID == 0  ){
        wp_set_current_user( $wp_user_data->ID, $wp_user_data->user_login );
        wp_set_auth_cookie( $wp_user_data->ID, true, $secure );
         do_action( 'wp_login', $wp_user_data->user_login);
        //wp_redirect( admin_url().'profile.php');
        // exit;
this will be resolved/fixed on next coming 1.7.4 version
...
User avatar
kaspir
Moderator
Moderator
Posts: 88
Joined: Mon Mar 20, 2017 2:38 pm
Location: USA
Contact:

Re: Woocommerce - Missing argument warning on WP login - temp fix

Post by kaspir »

Confirmed, updated to 1.7.4 and reverted my changed in woo commerce file, this issue is resolved in this patch. closing topic.
Image
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads. :P
Locked