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

Footnotes Block: Asterisk appear instead of number #57598

Closed
t-hamano opened this issue Jan 5, 2024 · 2 comments · Fixed by #58791
Closed

Footnotes Block: Asterisk appear instead of number #57598

t-hamano opened this issue Jan 5, 2024 · 2 comments · Fixed by #58791
Labels
[Block] Footnotes Affects the Footnotes Block [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Jan 5, 2024

Description

When I apply footnotes to inline text, the asterisk appears instead of the sequential number. If I select the RichText with that asterisk in it, the correct number seems to display.

If I disable the Gutenberg plugin, this problem will not reappear.

When I used git bisect to find the cause, it seems that the problem first occurred in #43204.

Step-by-step reproduction instructions

Check the text immediately after applying the footnote block.

Screenshots, screen recording, code snippet

77fc1af27d8db0fb1884b90378360855.mp4

Environment info

  • Gutenberg version: 17.4.1
  • WordPress version: 6..4.2
  • Browser:

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

Yes

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

Yes

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Footnotes Affects the Footnotes Block labels Jan 5, 2024
@mcsf
Copy link
Contributor

mcsf commented Jan 5, 2024

Thanks for the report. I'm noticing something which feels similar, whereby indices aren't properly updated when blocks aren't reordered:

footnotes-stale-indices.mov

@mcsf
Copy link
Contributor

mcsf commented Jan 5, 2024

Very quick debugging: In both cases (with asterisks when inserting a new footnote, and with stale indices when reordering blocks) the actual updating of rich-text values is done at the time of the action. Which is as expected. So is the problem that the values aren't properly flushed elsewhere?

Since you bisected the bug down to #43204, some hypotheses come to mind:

  • Now that we deal with RichTextData instances, some piece of the system is reusing the same object instance, which causes some strict equality check to wrongly assume that there are no changes.
  • Alternatively, RichTextData's interface is failing to update internal references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Footnotes Affects the Footnotes Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants