• Notice: unserialize(): Error at offset 0 of 2 bytes in /plugins/ajax-upload-for-gravity-forms/gravity-forms-ajax-upload-list-field.php on line 83
    Hi please advise,

    I am receiving such warning error on my website. please advise

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ovann86

    (@ovann86)

    Hey,

    When do you see this message?

    What are the steps to reproduce it?

    Does it only happen on a particular form or entry being viewed, or all forms or all pages etc?

    I’ve looked at the line you mentioned and it could be caused by corrupt (or incorrect) entry data. So at a guess, you’re only seeing it on a particular entry or only entries that have been affected by what ever is going wrong.

    I’m leaning towards something else is going on with your form that’s doing this, but if you can let me know more info I’ll see if I can reproduce it here.

    Plugin Author ovann86

    (@ovann86)

    If you’re stuck and not able to view an entry, you might be able to run a filter like below (i’ve only briefly tested it – and wouldn’t recommend leaving it active – only use it to retrieve the corrupt data).

    add_filter( 'gform_get_field_value', 'itsg_fix_list_unserialize_error', 1, 3 );
    function itsg_fix_list_unserialize_error( $value, $entry, $field ) {
    
        if( 'list' == $field->get_input_type() ) {
    		$value = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function( $match ) {      
    			return ( $match[1] == strlen( $match[2] ) ) ? $match[0] : 's:' . strlen( $match[2] ) . ':"' . $match[2] . '";';
    		}, $value );
    	}
    
        return $value;
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: unserialize(): Error’ is closed to new replies.