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

Potential regression in TemplateLock behavior. #60026

Closed
youknowriad opened this issue Mar 20, 2024 · 3 comments · Fixed by #60167
Closed

Potential regression in TemplateLock behavior. #60026

youknowriad opened this issue Mar 20, 2024 · 3 comments · Fixed by #60167
Assignees
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@youknowriad
Copy link
Contributor

Description

I've received some information (DM) that 6.5 may have introduced a regression in the TemplateLock behavior.

Step-by-step reproduction instructions

The conditions are supposed to be the following:

  • A container with "templateLock=all" (can be top level wp.data.dispatch( 'core/block-editor' ).updateSettings( { templateLock: 'all' } ) )
  • An unlocked nested container within that locked container.
  • You should be able to transform blocks that are within the nested container but apparently it's not possible anymore in 6.5.

Unfortunately, I don't have more information than that. This needs to be investigated to confirm whether there's a real regression or not.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. and removed Needs Testing Needs further testing to be confirmed. labels Mar 20, 2024
@youknowriad
Copy link
Contributor Author

I've received more information and you should be able to reproduce this issue using this code (when creating a new post)

add_filter(
	'register_post_type_args',
	function( $args, $post_type ) {

		if ( 'post' !== $post_type ) {
			return $args;
		}

		$args['template'] = [
			[
				'core/paragraph',
				[
					'placeholder' => 'Your content',
				],
			],
			[
				'core/group',
				[
					'templateLock' => false,
				],
				[
					[
						'core/paragraph',
						[
							'placeholder' => 'You should be able to transform this',
						],
					]
				]
			],
		];

		$args['template_lock'] = 'all';

		return $args;

	},
	10,
	2
);

@youknowriad
Copy link
Contributor Author

A potential regression of #57892 cc @ntsekouras

@jordesign jordesign added the [Feature] Templates API Related to API powering block template functionality in the Site Editor label Mar 20, 2024
@annezazu annezazu moved this to ❓ Triage in WordPress 6.5 Editor Tasks Mar 21, 2024
@annezazu
Copy link
Contributor

Adding to 6.5 to keep track but unclear if it should be for a point release or to fix in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants