• lazardanlucian

    (@lazardanlucian)


    error in javascript file :

    /enable-jquery-migrate-helper/js/deprecation-notice.js:131

    =================================================================

    	/**
    	 * Try to log the deprecation for the admin area.
    	 *
    	 * @param message
    	 */
    	function reportDeprecation( message ) {
    		// Do not write to the logfile if this is the backend and the notices are written to the screen.
    		if ( JQMH.backend && notice.length ) {
    			return;
    		}
    
    		if ( ! JQMH.capture_deprecations ) {
    			return;
    		}
    
    		let data = {
    			action: 'jquery-migrate-log-notice',
    			notice: message,
    			nonce: JQMH.report_nonce,
    			backend: JQMH.backend,
    			url: window.location.href,
    		};
    
    		$.post( {
    			url: JQMH.ajaxurl,
    			data
    		} );
    	}

    ^ data key is missing any value and : colons

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter lazardanlucian

    (@lazardanlucian)

    $.post( {
    url: JQMH.ajaxurl,
    data <<<<< here >>>>>
    } );

    Plugin Author Marius L. J.

    (@clorith)

    Hi,

    There is no error here, the data variable is defined just above the $.post line.

    Thread Starter lazardanlucian

    (@lazardanlucian)

    Defined but not used.
    Sorry but I caught this due to error reporting so please look again.

    It should be:

    $.post( {
    url: JQMH.ajaxurl,
    data: $data
    } );

    To effectively pass the $data as data key.

    Instead in the original code, $data is not passed, just data as a key

    Thread Starter lazardanlucian

    (@lazardanlucian)

    You are not passing the $data variable…

    Thread Starter lazardanlucian

    (@lazardanlucian)

    Oh wait. This is JavaScript. Sorry I’m a bit tipsy.

    You are right.
    I will follow back with the effective error to see if you figure out why it gets logged as an error.

    Thread Starter lazardanlucian

    (@lazardanlucian)

    Because the error was reported after installing Sentry as our error reporting tool.
    And it complained about data being empty

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘bug/error’ is closed to new replies.