Stackable icon indicating copy to clipboard operation
Stackable copied to clipboard

fix(posts): use uniqueId as stkQueryId to ensure uniqueness even when…

Open Arukuen opened this issue 1 year ago • 3 comments

… duplicated

fixes #3189

The problem arises from the stkQueryId attribute being also duplicated when the post block is duplicated. Only unique stkQueryId is assigned when new post blocks are created using useInstanceId.

Question: Is there a reason why in the previous implementation, uniqueId, which is always unique, was not used? If so, I can change the implementation to check all post blocks first before assigning stkQueryId to ensure uniqueness.

Arukuen avatar Aug 11 '24 14:08 Arukuen

🤖 Pull request artifacts

file commit
pr3289-stackable-3289-merge.zip 61369fd19500f2aa3124abcafd0b519a5a057416

github-actions[bot] avatar Aug 11 '24 15:08 github-actions[bot]

Try this Pull Request in the WordPress playground: https://playground.wordpress.net/?mode=seamless#{"landingPage":"/wp-admin/post-new.php?post_type=page","preferredVersions":{"php":"latest","wp":"latest"},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://raw.githubusercontent.com/gambitph/Stackable/artifacts/pr3289-stackable-3289-merge.zip"}}]}

github-actions[bot] avatar Aug 11 '24 15:08 github-actions[bot]

Question: Is there a reason why in the previous implementation, uniqueId, which is always unique, was not used? If so, I can change the implementation to check all post blocks first before assigning stkQueryId to ensure uniqueness.

I believe that we were copying how it was done in the native posts block, where each post block has their own unique "instanceId" that is a marker so that query and pagination can be found when changing pages

bfintal avatar Aug 23 '24 15:08 bfintal