Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#49523 closed defect (bug) (fixed)

Twenty Twenty: searchform.php error

Reported by: fahimmurshed's profile fahimmurshed Owned by: ianbelanger's profile ianbelanger
Milestone: 5.4 Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: has-patch
Focuses: coding-standards Cc:

Description

twentytwenty/searchform.php

**18	ERROR	Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$unique_id".

// phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound
20	ERROR	Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$aria_label".

phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound

Attachments (5)

49523.diff (816 bytes) - added by fahimmurshed 3 years ago.
Patch
49523.2.diff (1.7 KB) - added by fahimmurshed 3 years ago.
Patch. Please ignore another patch file.
49523.3.diff (2.1 KB) - added by ianbelanger 3 years ago.
Updated patch with all variables updated
49523.4.diff (4.2 KB) - added by fahimmurshed 3 years ago.
Updated patch with all variables updated
49523.5.diff (4.3 KB) - added by fahimmurshed 3 years ago.
Updated final patch

Download all attachments as: .zip

Change History (15)

@fahimmurshed
3 years ago

Patch

@fahimmurshed
3 years ago

Patch. Please ignore another patch file.

#1 @fahimmurshed
3 years ago

  • Version set to 5.3.2

Please edit to add the version 5.3.2

Thanks.

@ianbelanger
3 years ago

Updated patch with all variables updated

#2 @ianbelanger
3 years ago

  • Keywords reporter-feedback added
  • Version changed from 5.3.2 to 5.3

Thanks for you patch @fahimmurshed, I tested it and found that there were 2 undefined variable notices, so I uploaded a new patch with all variables updated. Please test it to confirm that my patch works for you. Thanks

#3 @ianbelanger
3 years ago

  • Milestone changed from Awaiting Review to Future Release

#4 @fahimmurshed
3 years ago

Perfect!

I have removed the hyphen $twentytwenty_unique_id = twentytwenty_unique_id( 'search-form' );:18

Removed from this word search-form

Do you think that's the right decision?

@fahimmurshed
3 years ago

Updated patch with all variables updated

#5 @ianbelanger
3 years ago

  • Keywords commit added; reporter-feedback removed
  • Owner set to ianbelanger
  • Status changed from new to reviewing

I think that the hyphen needs to stay, so that the ID is something like search-form-1 vs search-form1. That is more in line with how things are done in WP. Thanks for submitting you patches.

#6 @fahimmurshed
3 years ago

I'll re-upload the correct patch, Ian.

Thanks so much for pointing me. You know I am learning day by day :D

@fahimmurshed
3 years ago

Updated final patch

#7 @ianbelanger
3 years ago

  • Milestone changed from Future Release to 5.4

#8 @ianbelanger
3 years ago

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

In 47393:

Bundled Themes: Twenty Twenty searchform.php error.

Fixes phpcs error in the searchform.php file. The variables in this file were not prefixed correctly.

Props fahimmurshed.
Fixes #49523.

#9 @ianbelanger
3 years ago

  • Keywords fixed-major added; commit removed
  • Milestone changed from 5.4 to 5.3.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport.

#10 @audrasjb
3 years ago

  • Keywords fixed-major removed
  • Milestone changed from 5.3.3 to 5.4
  • Resolution set to fixed
  • Status changed from reopened to closed

Moving 5.3.3 Bundled Themes tickets back to milestone 5.4 as RC1 is approaching.

Note: See TracTickets for help on using tickets.