Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#37258 closed defect (bug) (duplicate)

Missing parameter in getNodes method of wp.mce.views

Reported by: programmin Owned by:
Priority: normal Milestone:
Component: Editor Version: 4.6
Severity: normal Keywords:
Cc: Focuses:

Description

In current WP, and in last few versions, calling a view's getNodes with callback, expects a callback that will take:

editor, this, $( this ).find( '.wpview-content' ).get( 0 )

as arguments.

https://core.trac.wordpress.org/browser/tags/4.5.3/src/wp-includes/js/mce-view.js#L379

In current WP 4.6 beta, this same getNodes function expects a callback to accept only editor, and this as arguments:

                getNodes: function( callback, rendered ) {
                        this.getEditors( function( editor ) {
                                var self = this;

                                $( editor.getBody() )
                                        .find( '[data-wpview-text="' + self.encodedText + '"]' )
                                        .filter( function() {
                                                var data;

                                                if ( rendered == null ) {
                                                        return true;
                                                }

                                                data = $( this ).data( 'rendered' ) === true;

                                                return rendered ? data : ! data;
                                        } )
                                        .each( function() {
                                                callback.call( self, editor, this );
                                        } );
                        } );
                },

Was there a reason for this breaking change, a reworking of wp-views system? Or just removing the redundant parameter?

Change History (3)

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.


10 years ago

#2 @iseulde
10 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Thanks for the ticket! Let's close this in favour of #36434, which is still open? There's a patch there as well.

This ticket was mentioned in Slack in #core-editor by ocean90. View the logs.


10 years ago

Note: See TracTickets for help on using tickets.