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

Fix empty links being created for the author's name comment #44650

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

Lucisu
Copy link
Contributor

@Lucisu Lucisu commented Oct 3, 2022

What?

It fixes issue #44648, which creates a link for the author's name, even if there's no URL provided in the comment posting form.

Why?

Now the author's name is not displayed as a link.

How?

Just by adding an empty check.

Testing Instructions

  1. Using Twenty Twenty-Three, add a comment to a post.
  2. Enter a comment, a name, and an email but don't enter any website URL.
  3. In your dashboard, approve the comment.
  4. Visit the post on the frond-end to see your new comment.

@Lucisu Lucisu requested a review from ajitbohra as a code owner October 3, 2022 16:37
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 3, 2022
@github-actions
Copy link

github-actions bot commented Oct 3, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Lucisu! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Lucisu Lucisu changed the title Fix issue #44648 Fix empty links being created for the author's name comment Oct 3, 2022
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Comment Author Affects the Comment Author Block labels Oct 3, 2022
Copy link
Contributor

@alexstine alexstine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Lucisu . This looks good to me.

https://developer.wordpress.org/reference/functions/get_comment_author_url/

This returns empty so checking it with empty seems fine. I am not worried about "0" in this context since this field should be somewhat sanitized.

Copy link
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me, thank you.

@Mamaduka Mamaduka merged commit b1f1d56 into WordPress:trunk Oct 4, 2022
@github-actions
Copy link

github-actions bot commented Oct 4, 2022

Congratulations on your first merged pull request, @Lucisu! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 14.3 milestone Oct 4, 2022
@ockham ockham added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 8, 2022
@ockham
Copy link
Contributor

ockham commented Oct 10, 2022

I just cherry-picked this PR to the wp/6.1 branch to get it included in the next release: 9d79474

@ockham ockham removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 10, 2022
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Oct 11, 2022
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [WordPress/gutenberg#43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [WordPress/gutenberg#44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [WordPress/gutenberg#44150 Gutenberg PR 44150] - Refresh selection styles
* [WordPress/gutenberg#44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [WordPress/gutenberg#44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [WordPress/gutenberg#44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [WordPress/gutenberg#44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [WordPress/gutenberg#44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [WordPress/gutenberg#44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [WordPress/gutenberg#44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [WordPress/gutenberg#44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [WordPress/gutenberg#44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [WordPress/gutenberg#44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [WordPress/gutenberg#44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [WordPress/gutenberg#44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54483 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Oct 11, 2022
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [WordPress/gutenberg#43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [WordPress/gutenberg#44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [WordPress/gutenberg#44150 Gutenberg PR 44150] - Refresh selection styles
* [WordPress/gutenberg#44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [WordPress/gutenberg#44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [WordPress/gutenberg#44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [WordPress/gutenberg#44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [WordPress/gutenberg#44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [WordPress/gutenberg#44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [WordPress/gutenberg#44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [WordPress/gutenberg#44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [WordPress/gutenberg#44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [WordPress/gutenberg#44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [WordPress/gutenberg#44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [WordPress/gutenberg#44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54483


git-svn-id: http://core.svn.wordpress.org/trunk@54042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to platformsh/wordpress-performance that referenced this pull request Oct 11, 2022
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [WordPress/gutenberg#43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [WordPress/gutenberg#44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [WordPress/gutenberg#44150 Gutenberg PR 44150] - Refresh selection styles
* [WordPress/gutenberg#44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [WordPress/gutenberg#44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [WordPress/gutenberg#44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [WordPress/gutenberg#44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [WordPress/gutenberg#44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [WordPress/gutenberg#44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [WordPress/gutenberg#44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [WordPress/gutenberg#44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [WordPress/gutenberg#44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [WordPress/gutenberg#44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [WordPress/gutenberg#44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [WordPress/gutenberg#44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54483


git-svn-id: https://core.svn.wordpress.org/trunk@54042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
ootwch pushed a commit to ootwch/wordpress-develop that referenced this pull request Nov 4, 2022
Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [WordPress/gutenberg#43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [WordPress/gutenberg#44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [WordPress/gutenberg#44150 Gutenberg PR 44150] - Refresh selection styles
* [WordPress/gutenberg#44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [WordPress/gutenberg#44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [WordPress/gutenberg#44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [WordPress/gutenberg#44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [WordPress/gutenberg#44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [WordPress/gutenberg#44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [WordPress/gutenberg#44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [WordPress/gutenberg#44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [WordPress/gutenberg#44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [WordPress/gutenberg#44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [WordPress/gutenberg#44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [WordPress/gutenberg#44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.

git-svn-id: https://develop.svn.wordpress.org/trunk@54483 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comment Author Affects the Comment Author Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Comment author name block: author name is linked even if the author has not provided a website's URL
5 participants