-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Template activation: move to experiment #73252
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
Conversation
|
Size Change: +2.76 kB (+0.11%) Total Size: 2.51 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| @@ -1,5 +1,52 @@ | |||
| <?php | |||
|
|
|||
| // Migrate existing "edited" templates. By existing, it means that the template | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is not landing in wordpress-6.9, should we move all the related files to 7.0
|
I wonder also if we had the "duplicate" action before or if we added it as part of this work? |
|
@ellatrix wait forget the previous feedback, It's all good now but I swear something enabled the experiment after I disabled it explicitly. |
68cefc3 to
091420a
Compare
|
Ok here's what happens for me:
It is possible that is due to the fact that I also have WP 6.9 running. I believe we need to avoid the auto re-enabling somehow. |
|
Looks like I have WP 6.9 beta 1, so maybe not something that need fixing since newer betas/RC don't include template activation. |
|
Other than that auto-switching issue, it's all good for me. |
The auto-switching is for 6.9-beta and not something we should fix right? |
Yeah, I think it's less important that I thought originally, It might impact some folks though, so I wonder if there's an easy fix, if not, maybe it's ok to ship as is. |
|
I'm a bit confused when the auto-switching happens. You're referring to this right? Does this also happen outside of 6.9-beta? Or which people might be impacted? |
|
I don't know if it happens outside 6.9 beta, since I only tested on 6.9 beta 1. My guess is it doesn't. But I was thinking that some folks might be running these broken 6.9 beta versions with Gutenberg with no? (could be an insignificant number though) |
|
@youknowriad Hm, I'm not sure how would would disable the code that 6.9-beta has? They'd just have to upgrade to 6.9-rc? And yes, the experiment will be on there, as expected. They should de-duplicate the templates and then untoggle the experiment |
mcsf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested well for me. While an intimidating patch at first, it reads well and makes sense. Nice work! Let's merge and 🤞.
| value="1" | ||
| <?php checked( 1, gutenberg_is_experiment_enabled( 'active_templates' ) ); ?> | ||
| /> | ||
| <?php echo __( 'Allows multiple templates of the same type to be created, of which one can be active at a time.', 'gutenberg' ); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action needed here, but reading this line makes me think that all/most experiments ought to have links to, at the very least, an issue or PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that's a good idea. Should I add a link here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Flaky tests detected in a8946b0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19473173687
|
Co-authored-by: ellatrix <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: mcsf <[email protected]>
Co-authored-by: ellatrix <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: mcsf <[email protected]>
|
I just cherry-picked this PR to the release/22.1 branch to get it included in the next release: ebbc859 |


What?
We need to look through #73025 and make sure we wrap everything is conditions and otherwise restore the old code. Basically we want both versions at the same time. I've also restored the old e2e test file, and we should keep the current one as well.
One issue: when you start duplicating and create multiple of the same template, the old system might get confused about which template is active. Generally we don't really want people to switch between these experiments as it's hard to migrate back.
Perhaps we should delete all newly created templates? But that would be content loss. Maybe we should disallow unchecking the experiment and put a big warning before enabling? IDK.What I went for in the end is warn about toggling it off. People should make sure they don't have any templates other than active ones.
Why?
We need some more time to make template activation work well UI wise.
How?
For anyone who has a version of GB where template activation was active, we auto-enable the experiment.
Testing Instructions
Toggle the experiment on/off. If you earlier had GH trunk, it will already be on.
Testing Instructions for Keyboard
Screenshots or screencast