Home Forums WC Vendors Pro Support Error on adding product

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #41186
    Danny Kater
    Participant

    Warning: urlencode() expects parameter 1 to be string, array given in /homepages/10/d622714196/htdocs/clickandbuilds/OoOCAZ/wp-includes/formatting.php on line 4694

    Above error is showing up as soon as i select one category or multiple categories on adding a product. If I don’t select a category, there’s no error?

    It doesn’t matter if I select another setting for “Category Display”. On both Checklist and Multi Select I get the error.

    #43174
    Danny Kater
    Participant

    Same topic: https://www.wcvendors.com/help/topic/urlencode-error-message-when-adding-product/

    Question from Ben: If you go back to the default templates, do you still get this error?

    My answer: Yes i do still get this error.

    The problem seems to be that there is an Array with the CategoryID passed into urlencode() instead of a string with the CategoryID.

    Once I change the Select Name from product_cat[] to product_cat a string is returned, but the cat is not saved?

    Can you help me?

    #43227
    Anna
    Member

    Hello,
    Have you tried any of the standard debugging (disable all plugins except woocommerce, wc vendors and wc vendors pro… install & activate the storefront theme..)? https://www.wcvendors.com/help/topic/read-before-requesting-support/

    Are you still able to select categories? Does this selection save when you add or update the product?

    #43498
    Danny Kater
    Participant

    It seems to be caused by YITH WooCommerce Ajax Product Filter. Will try to figure it out with them.

    Thanks!

    #48445
    Rachanee
    Participant

    Hi,

    I have the same problem, I am using Handy theme and it requires that plugin to work so theres no way I can remove it from the website? Anyone here sort of got the answer to this problem already? Thanks

    #48480
    Danny Kater
    Participant

    Hi Rachanee,

    It seems that after one of the last updates at least the category is added right to the product.

    Just still getting the urlencode() error. Same for you?

    Talking to YITH on their support forum: https://wordpress.org/support/topic/bug-array-parsed-into-urlencode/ Please join in on this forum as well please.

    Cheers

    #48563
    Becky
    Participant

    Any luck with this? Having the same error

    #48572
    Danny Kater
    Participant

    For now I just edited WP’s wp-includes/formatting.php from line 4694 and added:

    	$array = $path;
    	$can_foreach = is_array($array) || is_object($array);
    	if ($can_foreach) {
    		foreach ($array as $single_path){
    			$path = $single_path;
    		}
    	}

    This changes the array to an string. Will be removed once WP is updated, so hope that YITH can reproduce the error and solve it asap.

    Cheers.

    #49584
    Anonymous
    Inactive

    @dannykater

    It should looks like this? Or i got it wrong?

    
    $array = $path;
    	$can_foreach = is_array($array) || is_object($array);
    	if ($can_foreach) {
    		foreach ($array as $single_path){
    			$path = $single_path;
    		}
    	}
    
    function wp_basename( $path, $suffix = '' ) {
    
    	return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
    }
    

    For me it does not work. I also add reply to https://wordpress.org/support/topic/bug-array-parsed-into-urlencode/

    #49594
    Danny Kater
    Participant

    @localbrands It should look like this:

    function wp_basename( $path, $suffix = '' ) {
    	$array = $path;
    	$can_foreach = is_array($array) || is_object($array);
    	if ($can_foreach) {
    		foreach ($array as $single_path){
    			$path = $single_path;
    		}
    	}
    	return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
    }
    #49957
    Anonymous
    Inactive

    @dannykater

    Super – it works!

    Thanks a lot!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.