Hi all,

I installed Easylinks a few days ago. Looks good, but one thing doesn't work properly:

When a user clicks the 'report broken link' button, the page is directed to the wrong URL!

Example: http://www.website.nl/base//base/easylinks/2/reportbroken?destination=ea...

The place it SHOULD be pointing to is: http://www.website.nl/base/easylinks/2/reportbroken?destination=easylinks

As you can see, it inserts an extra "/base/" into the address! This only happens for the "report broken link", the create and view links work great. I looked through the code in the easylink.module, but couldn't figure out where it gets the URL from (or more specifically the extra "/base/" part).

Does anyone have a suggestion how to fix this?

Thank you!

Harro

Comments

Gurpartap Singh’s picture

Try changing the line no. 509 in easylinks.module to:

$rows[] = array(l('<img src="misc/watchdog-error.png" alt="(X)"/>', "easylinks/$link->lid/reportbroken", array(), $destination,NULL,FALSE,TRUE),"<a href='" . $link->url . "' target='new_page'>" . $link->sitename . "</a>", $link->sitedesc);

Please let me know if this fix works.

harro’s picture

This fixes the aforementioned problem! Excellent. If I find out this has other effects, I will post it back here again.

Could you describe shortly what you changed (or to put it differently: what you think the problem was), for future reference?

Thank you,

Harro

Gurpartap Singh’s picture

Status: Active » Reviewed & tested by the community

There was url() usage in path parameter for l() function on above stated line.

They are not meant to be used together in regular cases. url() function would return a complete path including subdirectories where your drupal installation exists (except domain/host).

like url('admin/easylinks') will return : '/subdirectory/drupal/?q=admin/easylinks' and would link accordingly to the root of your host.

Whereas l() function automatically does this for us. So no need of url() here.

Thanks for the find, I'll fix in CVS soon.

jaks1970’s picture

I have a similar problem but in my case my website name is missing from the link.
The link comes up as http://easylinks/1/reportbroken?destination=easylinks. I also looked at the code and couldn't figure it out. I literally downloaded and installed this tonight so it's the latest version for sure.

I know this is off topic but how can we add an alt"" tag to make it more SEO friendly? Also where would I edit to get the report this link image to the back of the link instead of the front? It looks bad where is is.

The edit you posted does not match my easylinks.modulefile. Similar code is on line 521 not 509. Is this what you ment?

$rows[] = array(l('<img src="misc/watchdog-error.png" alt="(X)"/>', url("easylinks/$link->lid/reportbroken"), array(), $destination,NULL,FALSE,TRUE),l($link->sitename, $link->url, array(target => $target)), $link->sitedesc);

Gurpartap Singh’s picture

Category: support » task
Status: Reviewed & tested by the community » Needs review
    Changes with this patch:
  • Removed 'edit easylinks' user permission. Instead, uses 'administer easylinks' permission.
  • Fixed broken 'report broken link' link, and added an alt ("(X)") and title ("Report this link as broken") for the image.
  • Changed description text for status of link in form on 'report broken link' page.
  • Few other text changes

Will attach a patched file in next followup. Please test/review and report broken code ;).

Gurpartap Singh’s picture

StatusFileSize
new4.96 KB

Oops, here's patch meant for above, and patched file follows.

Gurpartap Singh’s picture

StatusFileSize
new20.19 KB

And here the patched version.

jaks1970’s picture

Thanks for the quick update...:)

Is this patch to be done manually? I've never done a patch before in Drupal, if there is another way I wouldn't know. I could just remove the old module and try this one I only have one test link in it so far but would still like to know about the patch and how to apply it.

jaks1970’s picture

I uninistalled the old module, installed the patched one and renaming it back to easylinks.module before doing that. Seem to work great. I checked all functions and didn't have any probs.

Great work :)

I'm trying to figure out where where and how to add the title="" tag. Simply using the actual title as the filler for the tag. How do I do that?

Gurpartap Singh’s picture

Do you mean add title, alt to the outgoing link OR report broken image?

jaks1970’s picture

I mean title for the out going link. The report broken image already has the title alt :p

Gurpartap Singh’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)