Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various small bug fixes #207

Merged
merged 6 commits into from
Nov 25, 2023
Merged

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Nov 20, 2023

Summary

This PR can be summarized in the following changelog entry:

  • Fixes some small bugs that could result in PHP notices/warnings/errors.

Relevant technical choices:

Admin_Notifications::add_notification(): bug fix

The Admin_Notifications::add_notification() method only expects one parameter, so no need to ask WP for 2.

Downgrader::downgrade(): bug fix

The $adapter property does not exist. The $adapter local variable does.

Feature_Toggler::add_hooks(): use the correct function

The wpseo_enable_feature hook is a filter, not an action.

Plugin_Toggler::verify_nonce(): consistent return type

The return type is documented as bool, but the function contained a path which didn't return any value. Fixed now.

Admin_Page::add_assets(): bug fix

The third ($deps) parameter for wp_enqueue_style() expects an array of strings, not null.

Ref: https://developer.wordpress.org/reference/functions/wp_enqueue_style/

Plugin_Toggler::activate_plugin(): bug fix

The second ($redirect) parameter for activate_plugin() expects a string, not null.

Ref: https://developer.wordpress.org/reference/functions/activate_plugin/

Milestone

  • I've attached the next release's milestone to this pull request.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

only this part can be tested: Downgrader::downgrade(): bug fix:

  • Install and activate the latest Free and Test Helper
  • edit the Free source file lib/migrations/adapter.php at line 1049 from
		if ( $this->in_transaction === false ) {

to

		if ( true || $this->in_transaction === false ) {
  • visit Tools > Yoast Test
  • in the "Downgrade Yoast SEO" section, downgrade to 20.7 and save
  • with Test Helper versions up to 1.18-RC5, you would get a fatal error
  • with Test Helper versions 1.18-RC6, the operation would work as expected.

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Fixes #

@jrfnl jrfnl added this to the 1.19 milestone Nov 20, 2023
@jrfnl jrfnl force-pushed the JRF/various-small-bug-fixes branch from 8c75b37 to 33a5ae8 Compare November 24, 2023 23:16
@enricobattocchi enricobattocchi force-pushed the JRF/various-small-bug-fixes branch from 33a5ae8 to 4935514 Compare November 25, 2023 17:27
@enricobattocchi enricobattocchi changed the base branch from develop to release/1.18 November 25, 2023 17:27
 The `Admin_Notifications::add_notification()` method only expects one parameter, so no need to ask WP for 2.
The `$adapter` property does not exist. The `$adapter` local variable does.
The `wpseo_enable_feature` hook is a filter, not an action.
The return type is documented as `bool`, but the function contained a path which didn't return any value. Fixed now.
The third (`$deps`) parameter for `wp_enqueue_style()` expects an array of strings, not `null`.

Ref: https://developer.wordpress.org/reference/functions/wp_enqueue_style/
The second (`$redirect`) parameter for `activate_plugin()` expects a string, not `null`.

Ref: https://developer.wordpress.org/reference/functions/activate_plugin/
@enricobattocchi enricobattocchi force-pushed the JRF/various-small-bug-fixes branch from 4935514 to 395d8bf Compare November 25, 2023 17:29
@enricobattocchi enricobattocchi modified the milestones: 1.19, 1.18 Nov 25, 2023
Copy link
Member

@enricobattocchi enricobattocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! Rebasing to the release branch, aiming to release it before the end of the year

@enricobattocchi enricobattocchi merged commit 4cc6437 into release/1.18 Nov 25, 2023
10 checks passed
@enricobattocchi enricobattocchi deleted the JRF/various-small-bug-fixes branch November 25, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants