Closed Swanand01 closed 1 week ago
Size Change: 0 B
Total Size: 2.76 MB
Plugin builds for 26321cb4c84710bbef70ae6abad1124a2078b078 are ready :bellhop_bell:!
@swissspidy , I wasn't sure if WEBSTORIES_MINIMUM_WP_VERSION
in tests/phpstan/bootstrap.php
was supposed to be updated, since it was set to '0.0' while updating to WP 6.3, so I've left it as is.
Also, the PHP Unit tests against WP trunk are failing here too.
I wasn't sure if
WEBSTORIES_MINIMUM_WP_VERSION
intests/phpstan/bootstrap.php
was supposed to be updated, since it was set to '0.0' while updating to WP 6.3, so I've left it as is.
This never needs changing anymore. I will update the issue template accordingly. Sorry for the confusion.
Also, the PHP Unit tests against WP trunk are failing here too.
Yeah they will be failing everywhere :-) I'll have to find the core change that caused this and will check if we really need to adjust our tests or not. But that's something for a new issue/PR.
Let's include the post meta revision enhancement I mentioned on the issue here in this PR as well.
We can now also remove the function_exists( 'wp_prime_option_caches_by_group' )
check in the Settings::prime_option_caches()
method.
Generally speaking, with the bump to 6.4 we want to see adopt all the new features in 6.4 that are relevant for this plugin. The above are just a few examples that I saw, based on the field guide.
Hi @swissspidy,
I have used the revisions_enabled
argument when using register_post_meta
in Story_Post_Type::register_meta
. However, doing something similar in Product_Meta
causes some tests to fail.
The error that appears is: Function register_meta was called incorrectly. Meta keys cannot enable revisions support unless the object subtype supports revisions.
This is thrown in meta.php
, register_meta
function:
if ( ! empty( $object_subtype ) && ! post_type_supports( $object_subtype, 'revisions' ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Meta keys cannot enable revisions support unless the object subtype supports revisions.' ), '6.4.0' );
}
This shouldn't be happening, since we're passing 'object_subtype'
when calling Product_Meta::register_meta
, and the web-story
post type has declared support for revisions as well.
The issue is that Product_Meta::register_meta()
is called before the web-story
post type is registered in the Story_Post_Type
class. That's why post_type_supports( $object_subtype, 'revisions' )
returns false
.
Just had a quick look at it and the reason is surprisingly trivial:
The Product_Meta
class has a get_requirements()
method but does not actually implement the corresponding HasRequirements
interface. Fixing that resolves the issue.
Unfortunately this kind of stuff hasn't really been caught by tests (until now).
Summary
The goal of the PR is to Bump WordPress minimum to 6.4 in following:
readme.txt
web-stories.php
minimum_supported_wp_version
inphpcs.xml.dist
tests-e2e.yml
andtests-unit-php.yml
Story_Post_Type
class, ensurePOSTER_META_KEY
andPUBLISHER_LOGO_META_KEY
are part of revisionsProduct_Meta
class, ensurePRODUCTS_POST_META_KEY
is a part of revisionsUser-facing changes
Not applicable.
Testing Instructions
Not applicable.
Reviews
Does this PR have a security-related impact?
No.
Does this PR change what data or activity we track or use?
No.
Does this PR have a legal-related impact?
No.
Checklist
Type: XYZ
label to the PRFixes #13703