Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • johnrom

    (@johnrom)

    I’m also experiencing this with 7.6.0.

    Hi Alex,

    It was not a public plugin. I don’t think plugins should be switching out custom versions of WordPress-provided jQuery plugins, so I personally wouldn’t worry about this issue.

    If you really think it is necessary to fix, you can test the functionality by adding an action to wp_enqueue_scripts where you enqueue a custom version of jquery-serialize-object. Something like this should work:

    
    function algol_custom_assets() {
        
        wp_enqueue_script( 
            'custom-serialize-object', 
            'https://cdnjs.cloudflare.com/ajax/libs/jquery-serialize-object/2.4.5/jquery.serialize-object.min.js', 
            array('jquery'), 
            '2.4.5', 
            true 
        );
    }
    add_action('wp_enqueue_scripts', 'algol_custom_assets') );
    

    Then you should test if $_POST['json'] starts with ", and if so, run the commands I wrote in my previous comment.

    
    $json_string = trim( $_POST['json'], '"');
    $json_string = wp_unslash( $json_string );
    
    $json = json_decode( $json_string, true );
    

    John

    P.S., if they override jquery-serialize-object, Woo product variations no longer work either so exporting could be the least of the user’s problems.

    • This reply was modified 8 years, 1 month ago by johnrom.
    • This reply was modified 8 years, 1 month ago by johnrom.

    Hi Alex,

    It looks like another plugin was changing the version of jquery-serialize-object, and removing that plugin fixed things. Thanks for your help!

    John

    Hi Alex,

    In my opinion, having the $_POST overridden in the first place is making the debug process a headache (how were we ever to know $_POST should have been overridden without reading the entire plugin?). However, the issue here appears to be that the JSON is wrapped in an extra set of quotes.

    The form data being sent by JavaScript looks like this:

    json="{"settings":""}" which results in json_decode() returning a string that looks like {"settings":""}

    Additionally, stripslashes_deep doesn’t do exactly what is needed to parse this string, as there is an issue parsing "\"" from the slashes. It should use wp_unslash instead.

    The following is the code that allows me to properly save settings — though I still recommend not overriding $_POST!

    
    $_POST = array_map('stripslashes_deep', $_POST);
    
    // parse json to arrays?
    if ( ! empty( $_POST['json'] ) ) {
    	$json_string = trim( $_POST['json'], '"');
    	$json_string = wp_unslash( $json_string );
    
    	$json = json_decode( $json_string, true );
    
    	if(is_array($json)) {
    		$_POST = $_POST + $json;
    		unset( $_POST['json'] );
    	}
    }
    
    • This reply was modified 8 years, 1 month ago by johnrom.
    • This reply was modified 8 years, 1 month ago by johnrom.
    • This reply was modified 8 years, 1 month ago by johnrom.
    Thread Starter johnrom

    (@johnrom)

    No problem!

    Thread Starter johnrom

    (@johnrom)

    Hi Predrag,

    The problem is not that you cannot edit or scroll. The issue is that you cannot click within the box highlighted in my screenshot, specifically within the bounding box of wp-footer. If, as happened to me, the “save” button or any other UI item of a widget happens to fall within this box, you will not be able to click it. For a client, this could be very confusing since it is an invisible element.

    Also, I’m using Chrome Stable 53.0.2785.113 m x64 on Windows 10 x64 build 10586

    John

    • This reply was modified 9 years, 7 months ago by johnrom.
    Thread Starter johnrom

    (@johnrom)

    To clarify, I’m referring to any time the custom or core sidebars on the right are longer than the available widgets on the left. You can tell this is happening because the darker gray background on the right cuts off, and WP Footer “Thank you for Creating with WordPress” shows up before the end of the page. This footer is z-indexed higher than the sidebars themselves, so you’ll find that you are unable to click within the space that the footer takes up.

    I’m not sure how to upload an image for use on this forum, so I have chosen a random image upload website. Apologize in advance if this is not the recommended approach. The image below is taken from a fresh install of WordPress 4.6.1 with only Custom Sidebars 2.1.1.0 installed using Twenty Sixteen 1.1

    Brand New Widgets Page

    https://postimg.org/image/e6ettaigz/

    Thread Starter johnrom

    (@johnrom)

    I forgot to mention, this is importer because wp-footer will actually stop being pushed down, and is z-indexed higher than the widgets themselves, meaning in certain circumstances it can completely block a user from clicking the ‘save’ button or taking other actions on a widget.

    Thread Starter johnrom

    (@johnrom)

    Thanks Marcin, that did the trick.

    Hi Bozz,

    All instances of ‘WebPres_Woo_Product_Importer’ passed to call_user_func_array have to be replaced by an instantiated object. In this case, it would be &$this since it is within a class constructor.

    If you run a find/replace of ‘WebPres_Woo_Product_Importer’ with &$this, the error will go away and everything should go back to normal.

    Here is my version of woo_product_importer.php

    John

    I had this issue today when dealing with a client’s website. I created a temporary workaround for this, if you replace the class.cc.php file with this one, it should work:
    class.cc.php on pastebin

    More specifically, the get_contact function needs a third variable in order to override the transients and make sure we have the real contact in constantcontact.com.

    line 921 should be:

    function get_contact($id = null, $timeout = 3600, $refresh = false)

    line 925 should be adapted to use the third variable

    if( !empty($timeout) && !$refresh && $contact && (!isset($_GET['refresh']) || $_GET['refresh'] !== 'contact')) { return maybe_unserialize($contact); }

    Line 768, need to load the contact’s current lists and merge them.

    $contact = $this->get_contact($id, 3600, true);
    $current_lists = $contact['lists'];
    // email address is already listed in $email
    unset($additional_fields['EmailAddress']);
    if ( empty($additional_fields) && count(array_intersect($lists, $current_lists)) == count($lists) )
         return true; // already registered for all lists, nothing else to do, let's not send another request
    $lists = array_unique( array_merge($current_lists, $lists) );

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