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

"Rename" control for blocks within the Query Loop block are repeated #55517

Closed
hanneslsm opened this issue Oct 20, 2023 · 7 comments · Fixed by #55604
Closed

"Rename" control for blocks within the Query Loop block are repeated #55517

hanneslsm opened this issue Oct 20, 2023 · 7 comments · Fixed by #55604
Assignees
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Block settings menu The block settings screen [Type] Bug An existing feature does not function as intended

Comments

@hanneslsm
Copy link

hanneslsm commented Oct 20, 2023

Description

The rename option is getting repeated in query loops.

CC @andrewserong

Step-by-step reproduction instructions

  1. Use the query loop and create a stack within
  2. Open the options on the stack

Screenshots, screen recording, code snippet

image
Block Markup

<!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"enhancedPagination":true,"layout":{"type":"constrained"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|default"}},"layout":{"type":"flex","orientation":"vertical","flexWrap":"wrap","justifyContent":"stretch"}} -->
<div class="wp-block-group"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|tight"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:post-date {"style":{"elements":{"link":{"color":{"text":"var:preset|color|brand-dark-default"}}}},"textColor":"brand-dark-default","fontSize":"text-sm"} /-->

<!-- wp:post-author-name {"style":{"elements":{"link":{"color":{"text":"var:preset|color|brand-dark-default"}}}},"textColor":"brand-dark-default","fontSize":"text-sm"} /--></div>
<!-- /wp:group -->

<!-- wp:post-title /--></div>
<!-- /wp:group -->

<!-- wp:post-excerpt {"moreText":"\u003cem\u003eRead more\u003c/em\u003e","showMoreOnNewLine":false,"style":{"elements":{"link":{"color":{"text":"var:preset|color|dark-lighter"}}}}} /-->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|close","bottom":"var:preset|spacing|close","left":"var:preset|spacing|close","right":"var:preset|spacing|close"}}},"backgroundColor":"dark-contrast","layout":{"type":"flex","flexWrap":"nowrap"},"fontSize":"text-sm"} -->
<div class="wp-block-group has-dark-contrast-background-color has-background has-text-sm-font-size" style="padding-top:var(--wp--preset--spacing--close);padding-right:var(--wp--preset--spacing--close);padding-bottom:var(--wp--preset--spacing--close);padding-left:var(--wp--preset--spacing--close)"><!-- wp:paragraph -->
<p>Tags:</p>
<!-- /wp:paragraph -->

<!-- wp:post-terms {"term":"post_tag","style":{"elements":{"link":{"color":{"text":"var:preset|color|brand-dark-default"}}}}} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination --></div>
<!-- /wp:group -->

<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results --></div>
<!-- /wp:query -->

Environment info

  • WP 6.3.2
  • GB 16.8.1
  • Custom theme

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

No

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

No

@richtabor
Copy link
Member

richtabor commented Oct 20, 2023

I found this today as well. Perhaps we can get this in as a bug fix for 6.4 @annezazu @getdave @mikachan.

@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block [Feature] Block settings menu The block settings screen labels Oct 20, 2023
@richtabor richtabor changed the title Rename option in query loop gets also repeated "Rename" control for blocks within the Query Loop block are repeated Oct 20, 2023
@annezazu
Copy link
Contributor

Agreed. Adding this to to do as this is a gnarly bug.

@annezazu
Copy link
Contributor

Had more time to loop back on this and wanted to note that I can replicate with 6.4-RC1 (just to confirm that it is 6.4 related).

@richtabor
Copy link
Member

Yea, "Rename" in the menu is new to 6.4 if I'm remembering correctly.

@getdave
Copy link
Contributor

getdave commented Oct 23, 2023

100% agreed this needs to be fixed for 6.4. Probably via #55338.

@getdave getdave self-assigned this Oct 25, 2023
@getdave
Copy link
Contributor

getdave commented Oct 25, 2023

I realised that any fix here will need to be against the 6.4 branch and not trunk because 6.4 will not have the renaming for all blocks (only Group blocks) that is present in trunk.

@getdave
Copy link
Contributor

getdave commented Oct 25, 2023

Speaking to a few folks away from Github we determined the fix will require a refactoring the approach away from hooks. There is a PR WIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Block settings menu The block settings screen [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