The function _statistics_link() truncates the path to 35 chars, and it makes hard to read longer paths. It would be nice to have the title attribute in the link showing the full path.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LAsan’s picture

Version: x.y.z » 7.x-dev

Feature request go to cvs.

j.somers’s picture

Status: Active » Needs review
FileSize
1009 bytes
997 bytes

I attached a patch which implements this request.

Both patches achieve the same result but patch #1 uses an extra line to define the $options array while patch #2 combines it all in 1 single line.

Dries’s picture

The title_2.patch looks good to me. I wonder how necessary this patch is. Both Firefox and Safari, for example, show the URL in their status bar (i.e. the bar at the bottom). It makes this patch pretty redundant, IMO.

j.somers’s picture

I agree that it might be trivial but for some it might be easier to check the title attribute when they hover over it and I don't think it will cause much overhead.

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
753 bytes

+1 for this feature. I know some browsers show the full URL in the status bar, but some people may have the status bar hidden, or some users have lots of extensions that shorten the status bar. It would be useful to show this information. Re-rolled for HEAD.

Dave Reid’s picture

Title: title attribute in track links » Add title attribute to show the full URL with truncated links created with _statistics_link()
mcrittenden’s picture

Patch is a success for me. Definitely a useful feature and the patch only adds one more parameter. Cooperates with standards as well. Let's get this in.

Dave Reid’s picture

Feel free to mark as RTBC then. :)

j.somers’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks OK here too.

Dries’s picture

Browsers already show the complete URL when you hover over it. Do you have the "status bar" enabled in your browser? It does what you want it to do, and better. I'm tempted to mark this "won't fix".

mgifford’s picture

Issue tags: +Usability

I do really like this patch actually. Had put a similar request forward here - http://drupal.org/node/134090

It just makes it much more apparent to people. You can see the full link in the status bar, but I don't think most folks go there. However, if you see the link light up with the title it's really obvious.

Maybe some usability folks can comment on this.

Dave Reid’s picture

@Dries: This is actually the current behavior of the Drupal's URL input/text filter. See http://drupal.org/node/441414 for two examples of links that were truncated but display the full URL in the title attribute.

cburschka’s picture

Still RTBC, assuming it still clears testbot's latest round of retesting (apparently we just had a core commit).

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Reviewed & tested by the community

Pretty sure this was related to bot error. Resetting.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

deekayen’s picture

Status: Needs work » Reviewed & tested by the community

naughty pifr client

webchick’s picture

I know that in Safari, at least, the status bar is disabled by default (this routinely causes me to curse loudly and is probably the second thing I change on any new OSX install, after my password). So I can see the rationale for this patch. It's also consistent with the way the URL filter input format works as Dave Reid points out in #13, and having it pop up as a link title is more convenient to my eyeballs than breaking from the link I'm looking at and scanning way down at the bottom of my browser window and finding my way back again.

However, it really sounds like Dries is unconvinced, and it's also something we could always change after code-freeze, so I'm going to leave this at RTBC for now and move onto other issues.

mgifford’s picture

Ultimately it's a little thing affecting one small part of the admin screen for Drupal. However, if it makes the system more consistent and applies more information for the browser then why not? I haven't heard back from any of the usability folks. And yes, it can easily be applied after Sept 1st. I do wonder though how many other patches might fit into that category.

It may largely be about what browser you have and how you've got it configured. Or perhaps how you're used to using your browser. But I don't think most folks are looking for additional information in the status bar when they hover over a link.

sun’s picture

Status: Reviewed & tested by the community » Needs work

If this is a common browser problem, then trying to fix solely in statistics module's links is the wrong point to fix it. Fix l() instead.

sun’s picture

Status: Needs work » Needs review
FileSize
859 bytes

Quite some confusion here. The original patch in #2 displayed the URL alias as link title attribute, which is already displayed as link text, but truncated. Hovering over the link also displays that URL alias in the browser's status bar.

However, the internal system path is not displayed anywhere.

mgifford’s picture

Thanks @sun - your patch applies nicely.

Looking at the stats results here:
/admin/reports/hits

I'm getting this however:

<tr class="even">
<td class="nowrap active">04/30/2010 - 13:14</td>
<td>aa<br />
<a href="/one_with_a_really_really_really_long_url_that_should_be_split_if_anyone_really_cared_and_wanted_to_see_it" title="node/1">one_with_a_really_really_really ...</a></td>
<td><a href="/user/1" title="View user profile." class="username" xml:lang="" about="/user/1" typeof="sioc:UserAccount" property="foaf:name">openconcept</a></td>
<td><a href="/admin/reports/access/9">details</a></td>
</tr>

And I'm pretty sure we want:

 function _statistics_link($path, $width = 35) {
  $alias = drupal_get_path_alias($path);
  return l(truncate_utf8($alias, $width, FALSE, TRUE), $path, array('attributes' => array('title' => $alias)));
 }

Did you mean to use $path?

sun’s picture

Does it make sense to repeat the URL alias, which is already displayed in the browser's status bar?

mgifford’s picture

I think Dries made that argument somewhere. I couldn't find it. I think it works fine for geeks.

I do think that it's good to make it more obvious to people. If you're hovering over a partial link & want to see what the rest of it is it's not going to make sense to look down at the bottom of the browser.

From a usability perspective, I'm not sure how many people look down at the browser's status bar on a regular basis. It's outa the box & outa mind.

Putting the node ID as a reference could have some benefits, but the issue is about the full URL and not the node path.

ff1’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work

It's helpful, but doesn't fix any bugs, so according to Webchick's rules, this needs to move to D8.

Also, the latest patch doesn't add the intended feature, so marking as needs work.

karschsp’s picture

Status: Needs work » Needs review
FileSize
705 bytes

Here's a re-roll of #22 which incorporates mgifford's feedback from #23.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Patch still valid Hunk #1 succeeded at 386 with fuzz 1 (offset 8 lines).

Suppose it's good to have a title - no reason to move eyes to bottom of browser this could lead to loose focus on line you are see

catch’s picture

Issue tags: +Needs usability review

hmm I'm not sure either way on this, handing over to Bojhan/yoroy for an opinion.

Bojhan’s picture

Issue tags: -Needs usability review

Sounds fine, its a suuuper tiny improvement - for those who notice :) Does not make it less of an improvement, heh.

webchick’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Er. So did anyone actually try this patch? I don't really understand the point at all of displaying the exact link text in the title, which seems to be what it's doing right now:

Hovering over a link like node/1 displays a title of node/1... why?

I also don't know that I understand the value in displaying the full URL as shown in the status bar (localhost/8.x/node/1). It's not like various sub-domains' statistics are showing up here. All URLs here will be local to the current site.

GIven this, I also lean towards "won't fix" unless there's a compelling reason not to do that.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

More information was asked for 10 years ago and none has been provided. Also, the function _statistics_link was removed in #2343651: Remove most remaining l() calls in Drupal 8.0.x.

Therefore, closing as outdated. If this is incorrect reopen the issue, by setting the status to 'Active', and add a comment explaining what still needs to be done.

Thanks!