From 68b1e63080c253cd88b3d2fbe32805d11a1debfc Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 17 Jul 2014 13:57:29 +1200 Subject: [PATCH] Revert "MDL-46226 core: pix_icon no longer sets title to the alt text" This reverts commit 40ebfaeefd0940049ce2ef6e481546d90f19b9af. --- lib/outputcomponents.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 5b51cdf52c4..76b0c834387 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -510,8 +510,9 @@ class pix_icon implements renderable { if (empty($this->attributes['class'])) { $this->attributes['class'] = 'smallicon'; } - - if (empty($this->attributes['title'])) { + if (!isset($this->attributes['title'])) { + $this->attributes['title'] = $this->attributes['alt']; + } else if (empty($this->attributes['title'])) { // Remove the title attribute if empty, we probably want to use the parent node's title // and some browsers might overwrite it with an empty title. unset($this->attributes['title']); -- 2.39.2