Hi
If the primary service failed to deliver a shorten url, the module try to use the secondary service.
The secondary service is used only if the return of the first is null (shorten.module : l.152). But if the first service isn't found, the module return the original url, and so the secondary service can not be used.
I think the module should test if the url is null and not egal to the original :
//If the primary service fails or return the original url, try the secondary service.
if (!$url || $url == $original) {
$service = variable_get('shorten_service_backup', 'TinyURL');
if (isset($services[$service])) {
$url = _shorten_get_url($original, $services[$service]);
}
//If the secondary service fails, use the original URL.
if (!$url) {
$url = $original;
}
}
Best
Comments
Comment #1
JulienD commentedI join a patch file done on the 6.x-1.x-dev
Comment #2
icecreamyou commentedYou're quite right. Thanks for the patch, and it looks like it should work. I think a better solution might be to just return NULL in _shorten_get_url() on line 225 of shorten.module though, since that's what the current code in shorten_url() (rightfully) expects. I'll commit this hopefully later today.
Comment #3
icecreamyou commentedCommitted a fix to dev. Thanks.