When entering a piwik HTTP url without a trailing slash, the field fails validation.
e.g. http://analytics.example.com (no trailing slash)
The error message would be:
"The validation of "http://analytics.example.compiwik.php" failed with error "php_network_getaddresses: getaddrinfo failed: Name or service not known" (HTTP code 0)."

This can be confusing, as it is very subtle. It would be helpful if the form validator would automatically add the trailing slash, or some similar solution.

This is a usability bug.
Usability Heuristics:
Error Prevention
Even better than good error messages is a careful design which prevents a problem from occurring in the first place. Either eliminate error-prone conditions or check for them and present users with a confirmation option before they commit to the action.

Help users recognize, diagnose, and recover from errors
Error messages should be expressed in plain language (no codes), precisely indicate the problem, and constructively suggest a solution.
Source: http://www.useit.com/papers/heuristic/heuristic_list.html

CommentFileSizeAuthor
#2 piwik_url.patch1.51 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Category: bug » feature
Status: Active » Closed (works as designed)

The module does not try to fix user faults. The examples are there in the description. If you'd like to see it changed you can write a patch.

Anonymous’s picture

Status: Closed (works as designed) » Needs review
FileSize
1.51 KB

In the spirit of making things more usable and ensuring fewer errors I wrote a quick patch that will detect if there is a trailing slash and add one (if one is not present).

Would you consider committing this patch?

Anonymous’s picture

I just wanted to follow up and see if you've had a chance to review this patch?

Similarly, are there other usability items you are aware of that I could help out with?

moskito’s picture

That also happens in 6.x version.

hass’s picture

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

Code style issues exists.

Anonymous’s picture

I forgot to send this through coder for validation, my apologies.

I'm in the midst of a project launch at work right now, but wanted to update this thread that I will fix this patch, and also ensure it works with the 6.x version as well.

  • hass committed ba995a8 on 7.x-2.x
    Issue #1776938: Piwik HTTP URL Validation (trailing slash)
    

  • hass committed c6e7b5d on 6.x-2.x
    Issue #1776938: Piwik HTTP URL Validation (trailing slash)
    
hass’s picture

Issue summary: View changes
Status: Needs work » Fixed

Fixed substr with drupal_substr and committed.

  • hass committed d0f9b68 on 6.x-2.x
    Issue #1776938: Code style fix
    

  • hass committed afea4e2 on
    Issue #1776938: Code style fix
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

brylie’s picture

Thank you @nateswart :-)