Make WordPress Core

Opened 7 months ago

Closed 5 months ago

Last modified 5 months ago

#61754 closed defect (bug) (fixed)

Unused array_merge call?

Reported by: kkmuffme's profile kkmuffme Owned by: davidbaumwald's profile davidbaumwald
Milestone: 6.7 Priority: normal
Severity: normal Version: 5.0
Component: Script Loader Keywords: has-patch
Focuses: Cc:

Description

Attachments (2)

61754.diff (666 bytes) - added by SergeyBiryukov 5 months ago.
61754.2.diff (1.9 KB) - added by SergeyBiryukov 5 months ago.

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
7 months ago

  • Milestone changed from Awaiting Review to 6.7
  • Version set to 5.0

Good catch! Added in [44265] / #45348.

This ticket was mentioned in PR #7276 on WordPress/wordpress-develop by @akshat2802.


6 months ago
#2

  • Keywords has-patch added

https://core.trac.wordpress.org/ticket/61754
This PR removes unused Array Merge call from script-loader.php

#3 @davidbaumwald
6 months ago

  • Owner set to davidbaumwald
  • Status changed from new to reviewing

#4 @davidbaumwald
5 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 59033:

Script Loader: Remove unused array_merge.

This change removes an unused array_merge that was added in [44265].

Props kkmuffme, SergeyBiryukov, akshat2802.
Fixes #61754.

#5 @SergeyBiryukov
5 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I believe the intention in [44265] / #45348 was to actually merge the arrays, otherwise the wp_editor_settings filter is applied in wp_tinymce_inline_scripts(), but the result is not used anywhere:

/** This filter is documented in wp-includes/class-wp-editor.php */
$editor_settings = apply_filters( 'wp_editor_settings', array( 'tinymce' => true ), 'classic-block' );

#6 @davidbaumwald
5 months ago

@SergeyBiryukov Thanks! I'll revert r59033 and re-review.

#7 @davidbaumwald
5 months ago

In 59047:

Script Loader: Revert removing unused array_merge.

Code is poetry, until it isn’t.

Unprops davidbaumwald.
See #61754.

#8 @TobiasBg
5 months ago

@davidbaumwald: I think [59047] didn't revert [59033] but a piece of [59046]?

#9 @SergeyBiryukov
5 months ago

In 59051:

Script Loader: Restore user-profile.js dependencies after an accidental revert.

Follow-up to [59033], [59046], [59047].

Props TobiasBg.
See #61754.

#10 @SergeyBiryukov
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 59074:

Editor: Restore the merging of TinyMCE settings in wp_tinymce_inline_scripts().

This ensures that the function applies the wp_editor_settings filter and merges the resulting array with the rest of TinyMCE init settings.

Includes a unit test to verify that the settings are merged correctly after adding the assignment of array_merge() result that was missed in the initial commit.

Follow-up to [44265], [59033].

Props kkmuffme, akshat2802, davidbaumwald, SergeyBiryukov.
Fixes #61754.

@SergeyBiryukov commented on PR #7276:


5 months ago
#11

Thanks for the PR! Merged in r59033 and r59074.

Note: See TracTickets for help on using tickets.