Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37258 closed defect (bug) (duplicate)

Missing parameter in getNodes method of wp.mce.views

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

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.


8 years ago

#2 @iseulde
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

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.


8 years ago

Note: See TracTickets for help on using tickets.