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.
This commit is contained in:
Jun Pataleta
2025-10-16 15:48:32 +08:00
parent 0efd4011ad
commit b23bdb50b5
8 changed files with 11 additions and 11 deletions
@@ -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);
}
/**
@@ -138,7 +138,7 @@
}}>
<td>{{typename}}</td>
<td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}</td>
<td><a href="{{requestedbyuser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{requestedbyuser.fullname}}</a></td>
<td><a href="{{requestedbyuser.profileurl}}">{{requestedbyuser.fullname}}</a></td>
<td>
<span class="badge {{statuslabelclass}}" title="{{statuslabeltitle}}">{{statuslabel}}</span>
</td>
@@ -62,7 +62,7 @@
</div>
<div class="flex-grow-1 ms-3">
<h4 class="mt-0 mb-1">
<a href="{{foruser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{foruser.fullname}}</a>
<a href="{{foruser.profileurl}}">{{foruser.fullname}}</a>
</h4>
<a href="mailto:{{foruser.email}}">{{foruser.email}}</a>
<div class="clearfix mt-1 mb-1">
@@ -76,7 +76,7 @@
</span>
<span class="float-start me-1">
<strong>{{#str}}requestbydetail, tool_dataprivacy{{/str}}</strong>
<span><a href="{{requestedbyuser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{requestedbyuser.fullname}}</a></span>
<span><a href="{{requestedbyuser.profileurl}}">{{requestedbyuser.fullname}}</a></span>
</span>
</div>
{{#canreview}}
@@ -49,7 +49,7 @@
}
}}
<span>
<a href="{{profileurl}}" title="{{#str}}viewprofile{{/str}}">
<a href="{{profileurl}}">
<img height="18" src="{{profileimageurlsmall}}" alt="">
<span>{{fullname}}</span>
{{#hasidentity}}
+2 -2
View File
@@ -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 = "<a href=\"$CFG->wwwroot/user/profile.php?id=$USER->id\" title=\"$linktitle\">$fullname</a>";
$userurl = new moodle_url('/user/profile.php', ['id' => $USER->id]);
$username = html_writer::link($userurl, $fullname);
} else {
$username = $fullname;
}
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"