From b23bdb50b5a6099000f7d020d48bf9dc7dbabaca Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 31 Jul 2025 18:32:45 +0800 Subject: [PATCH] MDL-85796 core: Remove unnecessary title attribute on profile links The title attribute with value "View profile" on profile links is not necessary as the user's name on the link itself is sufficient to convey the purpose of the link. --- .../tool/dataprivacy/classes/output/data_requests_table.php | 4 ++-- .../tool/dataprivacy/templates/my_data_requests.mustache | 2 +- .../admin/tool/dataprivacy/templates/request_details.mustache | 4 ++-- public/admin/tool/lp/templates/user_summary.mustache | 2 +- public/lib/classes/output/core_renderer.php | 4 ++-- public/lib/tests/behat/switch_editing_mode.feature | 2 +- public/user/tests/behat/add_blocks.feature | 2 +- public/user/tests/behat/reset_page.feature | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/admin/tool/dataprivacy/classes/output/data_requests_table.php b/public/admin/tool/dataprivacy/classes/output/data_requests_table.php index 0ea44f4738d..d3dce96401f 100644 --- a/public/admin/tool/dataprivacy/classes/output/data_requests_table.php +++ b/public/admin/tool/dataprivacy/classes/output/data_requests_table.php @@ -162,7 +162,7 @@ class data_requests_table extends table_sql { */ public function col_userid($data) { $user = $data->foruser; - return html_writer::link($user->profileurl, $user->fullname, ['title' => get_string('viewprofile')]); + return html_writer::link($user->profileurl, $user->fullname); } /** @@ -183,7 +183,7 @@ class data_requests_table extends table_sql { */ public function col_requestedby($data) { $user = $data->requestedbyuser; - return html_writer::link($user->profileurl, $user->fullname, ['title' => get_string('viewprofile')]); + return html_writer::link($user->profileurl, $user->fullname); } /** diff --git a/public/admin/tool/dataprivacy/templates/my_data_requests.mustache b/public/admin/tool/dataprivacy/templates/my_data_requests.mustache index 0d1e5f35ef2..6664eba2737 100644 --- a/public/admin/tool/dataprivacy/templates/my_data_requests.mustache +++ b/public/admin/tool/dataprivacy/templates/my_data_requests.mustache @@ -138,7 +138,7 @@ }}> {{typename}} {{#userdate}} {{timecreated}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}} - {{requestedbyuser.fullname}} + {{requestedbyuser.fullname}} {{statuslabel}} diff --git a/public/admin/tool/dataprivacy/templates/request_details.mustache b/public/admin/tool/dataprivacy/templates/request_details.mustache index f4709bca52a..36f939ea58d 100644 --- a/public/admin/tool/dataprivacy/templates/request_details.mustache +++ b/public/admin/tool/dataprivacy/templates/request_details.mustache @@ -62,7 +62,7 @@

- {{foruser.fullname}} + {{foruser.fullname}}

{{foruser.email}}
@@ -76,7 +76,7 @@ {{#str}}requestbydetail, tool_dataprivacy{{/str}} - {{requestedbyuser.fullname}} + {{requestedbyuser.fullname}}
{{#canreview}} diff --git a/public/admin/tool/lp/templates/user_summary.mustache b/public/admin/tool/lp/templates/user_summary.mustache index 598f23f9530..32024031f7e 100644 --- a/public/admin/tool/lp/templates/user_summary.mustache +++ b/public/admin/tool/lp/templates/user_summary.mustache @@ -49,7 +49,7 @@ } }} - + {{fullname}} {{#hasidentity}} diff --git a/public/lib/classes/output/core_renderer.php b/public/lib/classes/output/core_renderer.php index 9d8680d81fe..1315b1b8ce4 100644 --- a/public/lib/classes/output/core_renderer.php +++ b/public/lib/classes/output/core_renderer.php @@ -650,8 +650,8 @@ class core_renderer extends renderer_base { $fullname = fullname($USER); // Since Moodle 2.0 this link always goes to the public profile page (not the course profile page) if ($withlinks) { - $linktitle = get_string('viewprofile'); - $username = "wwwroot/user/profile.php?id=$USER->id\" title=\"$linktitle\">$fullname"; + $userurl = new moodle_url('/user/profile.php', ['id' => $USER->id]); + $username = html_writer::link($userurl, $fullname); } else { $username = $fullname; } diff --git a/public/lib/tests/behat/switch_editing_mode.feature b/public/lib/tests/behat/switch_editing_mode.feature index ff8ccabc6aa..ba020227f1e 100644 --- a/public/lib/tests/behat/switch_editing_mode.feature +++ b/public/lib/tests/behat/switch_editing_mode.feature @@ -49,7 +49,7 @@ Feature: Turn editing mode on Scenario: Edit mode on page Profile Given I log in as "admin" - And I follow "View profile" + And I follow "Profile" in the user menu And I turn editing mode on And I should see "Add a block" And I turn editing mode off diff --git a/public/user/tests/behat/add_blocks.feature b/public/user/tests/behat/add_blocks.feature index 18145a843d7..646decbc1a3 100644 --- a/public/user/tests/behat/add_blocks.feature +++ b/public/user/tests/behat/add_blocks.feature @@ -17,7 +17,7 @@ Feature: Add blocks to my profile page | student1 | C1 | student | | student2 | C1 | student | And I log in as "admin" - And I follow "View profile" + And I follow "Profile" in the user menu Scenario: Add blocks to page When I turn editing mode on diff --git a/public/user/tests/behat/reset_page.feature b/public/user/tests/behat/reset_page.feature index c69b1c16888..67268340fc4 100644 --- a/public/user/tests/behat/reset_page.feature +++ b/public/user/tests/behat/reset_page.feature @@ -7,7 +7,7 @@ Feature: Reset my profile page to default @javascript Scenario: Add blocks to page and reset When I log in as "admin" - And I follow "View profile" + And I follow "Profile" in the user menu And I turn editing mode on And I add the "Latest announcements" block And I press "Reset page to default"