Make WordPress Core

Opened 5 weeks ago

Closed 29 hours ago

Last modified 2 hours ago

#62985 closed defect (bug) (fixed)

Fix layout support classes to be generated with a stable ID

Reported by: darerodz's profile darerodz Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

This ticket tracks the merging of PHP files for the following Gutenberg changes:

https://github.com/WordPress/gutenberg/pull/68210

This fixes a bug reported in https://github.com/WordPress/gutenberg/issues/67308 related to the Interactivity API's client-side navigation feature, which these layout classes affect. There was a previous attempt at https://core.trac.wordpress.org/ticket/59681 to solve the issue, but it was insufficient.

Change History (19)

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


5 weeks ago
#1

  • Keywords has-patch has-unit-tests added

This is a backport PR for WordPress 6.9 that includes the following PHP Gutenberg changes:

Trac ticket: https://core.trac.wordpress.org/ticket/62985

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


3 weeks ago

#3 @joemcgill
2 weeks ago

  • Keywords needs-testing has-testing-info added
  • Milestone changed from Awaiting Review to 6.8
  • Owner set to joemcgill
  • Status changed from new to reviewing

I'm adding this to the 6.8 milestone for consideration. @fabiankaegy and @Mamaduka could one of you confirm that the current PR addresses the issue reported in the GB repo?

For anyone else wanting to test this, reproduction steps can be found in https://github.com/WordPress/gutenberg/issues/67308.

@darerodz commented on PR #8353:


2 weeks ago
#4

Thanks, @joemcgill, for your review. 🙏

I'm adding tests for the wp_unique_id_from_values() function. They should be ready before these changes are merged.

@darerodz commented on PR #8353:


13 days ago
#5

@joemcgill, I just added PHPUnit tests for wp_unique_id_from_values() if you want to take a look.

#6 @joemcgill
8 days ago

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

In 60038:

Editor: Fix layout support classes to be generated with a stable ID.

This fixes a bug reported in https://github.com/WordPress/gutenberg/issues/67308 related to the Interactivity API's client-side navigation feature by replacing the incrementally generated IDs with stable hashes derived from the block's layout style definition.

Fixes #62985.
Props darerodz.

#7 @luisherranz
8 days ago

Thanks @joemcgill!

#8 @peterwilsoncc
3 days ago

  • Keywords needs-patch added; has-patch has-unit-tests needs-testing has-testing-info removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening this as the wp_unique_id_from_values() function includes an odd _doing_it_wrong() call.

  • There's an unused sprintf in the message as there is no placeholder
  • The empty( $data ) seems a little weird with the function signature wp_unique_id_from_values( array $data, string $prefix = '' ): string, as PHP will fatal if nothing/an incorrect type is passed, and getting a signature for an empty array while weird, seems like it could potentially be useful.

Edit: PR created for the first item, but thinking about it further I'm not sure it needs to be type strict at all. wp_unique_id_from_values( 'some string or type' ) could be potentially useful.

Last edited 3 days ago by peterwilsoncc (previous) (diff)

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


3 days ago
#9

  • Keywords has-patch added; needs-patch removed

A little tidy up of the DIW call within wp_unique_id_from_values():

  • Remove the unused sprintf
  • Figure whether the DIW should be used.

Trac ticket: https://core.trac.wordpress.org/ticket/62985

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 days ago

#11 @peterwilsoncc
41 hours ago

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

In 60075:

Editor: Tidy up _doing_it_wrong() call in wp_unique_id_from_values().

Adds a translator note not to translate the parameter name $data and removes an unused sprintf() that doesn't contain any placeholders.

Props peterwilsoncc, joemcgill.
Fixes #62985.

#12 @joemcgill
30 hours ago

In 60079:

Editor: Fix translators note in wp_unique_id_from_values().

Follow up to [60075] to fix a typo.

Props mukesh27, johnbillion.
See #62985.

#13 @darerodz
30 hours ago

Thanks, folks, for taking care of this!

#14 @swissspidy
30 hours ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This should use sprintf with a placeholder for the $data part.

#16 @audrasjb
29 hours ago

Self assigning for a quick follow-up fix (see the above PR).

#17 @audrasjb
29 hours ago

  • Owner changed from joemcgill to audrasjb
  • Status changed from reopened to assigned

#18 @audrasjb
29 hours ago

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

In 60085:

Coding Standards: Use sprintf() for correct i18n in wp_unique_id_from_values().

Follow-up to [60075], [60079].

Fixes #62985.

#19 @desrosj
2 hours ago

Just noting that [60038] is causing some failures in test reports from hosts. #63175 has been opened to follow up.

Note: See TracTickets for help on using tickets.