-
Notifications
You must be signed in to change notification settings - Fork 91
Fix: WordPress Importer does not remap noteId in block metadata when reassigning comment IDs #254
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
Open
hbhalodia
wants to merge
12
commits into
WordPress:master
Choose a base branch
from
hbhalodia:fix/core-trac-64724
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0e19c14
Add option to map the comments for comment type note with blocks
hbhalodia d59679d
Update the replace logic with shorter logic
hbhalodia d7bc676
Add return type
hbhalodia 039fc9b
Use WP_Block_Processor to update attributes metadata for noteId
hbhalodia 3f1980e
Update to use WP_Block_Processor and use span and noteId check to update
hbhalodia 1033408
Shorten the function doc comment
hbhalodia 8db9ccf
Update remapping notes function to use block_parser and use string op…
hbhalodia ba2fdc8
Remove extra line
hbhalodia dccc96b
Address feedbacks and build replacements
hbhalodia 91880cd
Address feedbacks
hbhalodia e86f185
Add unit test case for functionality
hbhalodia 244e627
Revert condition check for attribute_start
hbhalodia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. --> | ||
| <!-- It contains information about your site's posts, pages, comments, categories, and other content. --> | ||
| <!-- You may use this file to transfer that content from one site to another. --> | ||
| <!-- This file is not intended to serve as a complete backup of your site. --> | ||
|
|
||
| <!-- To import this information into a WordPress site follow these steps: --> | ||
| <!-- 1. Log in to that site as an administrator. --> | ||
| <!-- 2. Go to Tools: Import in the WordPress admin panel. --> | ||
| <!-- 3. Install the "WordPress" importer from the list. --> | ||
| <!-- 4. Activate & Run Importer. --> | ||
| <!-- 5. Upload this file using the form provided on that page. --> | ||
| <!-- 6. You will first be asked to map the authors in this export file to users --> | ||
| <!-- on the site. For each author, you may choose to map to an --> | ||
| <!-- existing user on the site or to create a new user. --> | ||
| <!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. --> | ||
| <!-- contained in this file into your site. --> | ||
|
|
||
| <!-- generator="WordPress/6.9.4" created="2026-03-24 10:39" --> | ||
| <rss version="2.0" | ||
| xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" | ||
| xmlns:content="http://purl.org/rss/1.0/modules/content/" | ||
| xmlns:wfw="http://wellformedweb.org/CommentAPI/" | ||
| xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
| xmlns:wp="http://wordpress.org/export/1.2/" | ||
| > | ||
|
|
||
| <channel> | ||
| <title>My WordPress Website</title> | ||
| <link>https://playground.wordpress.net/scope:creative-busy-garden</link> | ||
| <description></description> | ||
| <pubDate>Tue, 24 Mar 2026 10:39:41 +0000</pubDate> | ||
| <language>en-US</language> | ||
| <wp:wxr_version>1.2</wp:wxr_version> | ||
| <wp:base_site_url>https://playground.wordpress.net/scope:creative-busy-garden</wp:base_site_url> | ||
| <wp:base_blog_url>https://playground.wordpress.net/scope:creative-busy-garden</wp:base_blog_url> | ||
|
|
||
| <wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[admin@localhost.com]]></wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author> | ||
| <generator>https://wordpress.org/?v=6.9.4</generator> | ||
|
|
||
| <item> | ||
| <title><![CDATA[Page with notes and comments]]></title> | ||
| <link>https://playground.wordpress.net/scope:creative-busy-garden/page-with-notes-and-comments/</link> | ||
| <pubDate>Tue, 24 Mar 2026 10:38:09 +0000</pubDate> | ||
| <dc:creator><![CDATA[admin]]></dc:creator> | ||
| <guid isPermaLink="false">https://playground.wordpress.net/scope:creative-busy-garden/?page_id=10</guid> | ||
| <description></description> | ||
| <content:encoded><![CDATA[<!-- wp:heading {"metadata":{"noteId":3}} --> | ||
| <h2 class="wp-block-heading">Note on heading 1</h2> | ||
| <!-- /wp:heading --> | ||
|
|
||
| <!-- wp:paragraph {"metadata":{"noteId":2}} --> | ||
| <p>Paragraph with note 1</p> | ||
| <!-- /wp:paragraph -->]]></content:encoded> | ||
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | ||
| <wp:post_id>10</wp:post_id> | ||
| <wp:post_date><![CDATA[2026-03-24 10:38:09]]></wp:post_date> | ||
| <wp:post_date_gmt><![CDATA[2026-03-24 10:38:09]]></wp:post_date_gmt> | ||
| <wp:post_modified><![CDATA[2026-03-24 10:38:14]]></wp:post_modified> | ||
| <wp:post_modified_gmt><![CDATA[2026-03-24 10:38:14]]></wp:post_modified_gmt> | ||
| <wp:comment_status><![CDATA[open]]></wp:comment_status> | ||
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | ||
| <wp:post_name><![CDATA[page-with-notes-and-comments]]></wp:post_name> | ||
| <wp:status><![CDATA[publish]]></wp:status> | ||
| <wp:post_parent>0</wp:post_parent> | ||
| <wp:menu_order>0</wp:menu_order> | ||
| <wp:post_type><![CDATA[page]]></wp:post_type> | ||
| <wp:post_password><![CDATA[]]></wp:post_password> | ||
| <wp:is_sticky>0</wp:is_sticky> | ||
| <wp:comment> | ||
| <wp:comment_id>2</wp:comment_id> | ||
| <wp:comment_author><![CDATA[admin]]></wp:comment_author> | ||
| <wp:comment_author_email><![CDATA[admin@localhost.com]]></wp:comment_author_email> | ||
| <wp:comment_author_url>http://127.0.0.1:34717</wp:comment_author_url> | ||
| <wp:comment_author_IP><![CDATA[127.0.0.1]]></wp:comment_author_IP> | ||
| <wp:comment_date><![CDATA[2026-03-24 10:37:45]]></wp:comment_date> | ||
| <wp:comment_date_gmt><![CDATA[2026-03-24 10:37:45]]></wp:comment_date_gmt> | ||
| <wp:comment_content><![CDATA[Note on para 1]]></wp:comment_content> | ||
| <wp:comment_approved><![CDATA[0]]></wp:comment_approved> | ||
| <wp:comment_type><![CDATA[note]]></wp:comment_type> | ||
| <wp:comment_parent>0</wp:comment_parent> | ||
| <wp:comment_user_id>1</wp:comment_user_id> | ||
| </wp:comment> | ||
| <wp:comment> | ||
| <wp:comment_id>3</wp:comment_id> | ||
| <wp:comment_author><![CDATA[admin]]></wp:comment_author> | ||
| <wp:comment_author_email><![CDATA[admin@localhost.com]]></wp:comment_author_email> | ||
| <wp:comment_author_url>http://127.0.0.1:34717</wp:comment_author_url> | ||
| <wp:comment_author_IP><![CDATA[127.0.0.1]]></wp:comment_author_IP> | ||
| <wp:comment_date><![CDATA[2026-03-24 10:38:07]]></wp:comment_date> | ||
| <wp:comment_date_gmt><![CDATA[2026-03-24 10:38:07]]></wp:comment_date_gmt> | ||
| <wp:comment_content><![CDATA[Note on heading 1]]></wp:comment_content> | ||
| <wp:comment_approved><![CDATA[0]]></wp:comment_approved> | ||
| <wp:comment_type><![CDATA[note]]></wp:comment_type> | ||
| <wp:comment_parent>0</wp:comment_parent> | ||
| <wp:comment_user_id>1</wp:comment_user_id> | ||
| </wp:comment> | ||
| <wp:comment> | ||
| <wp:comment_id>4</wp:comment_id> | ||
| <wp:comment_author><![CDATA[admin]]></wp:comment_author> | ||
| <wp:comment_author_email><![CDATA[admin@localhost.com]]></wp:comment_author_email> | ||
| <wp:comment_author_url>http://127.0.0.1:34717</wp:comment_author_url> | ||
| <wp:comment_author_IP><![CDATA[127.0.0.1]]></wp:comment_author_IP> | ||
| <wp:comment_date><![CDATA[2026-03-24 10:38:26]]></wp:comment_date> | ||
| <wp:comment_date_gmt><![CDATA[2026-03-24 10:38:26]]></wp:comment_date_gmt> | ||
| <wp:comment_content><![CDATA[Comment on post Page with notes and comments]]></wp:comment_content> | ||
| <wp:comment_approved><![CDATA[1]]></wp:comment_approved> | ||
| <wp:comment_type><![CDATA[comment]]></wp:comment_type> | ||
| <wp:comment_parent>0</wp:comment_parent> | ||
| <wp:comment_user_id>1</wp:comment_user_id> | ||
| </wp:comment> | ||
| </item> | ||
| </channel> | ||
| </rss> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.