Download & Extend

Forward Services link is broken

Project:Service links
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,

Using Forward Services with the Service links module returns a 404 error page because the link parameter in forward_services.module line 16 is wrong.

'link' => '<front-page>forward&path=<encoded-query>',

The link should be written as forward?path with a question mark instead of an ampersand.

However, if this is changed in the above code, <front-page> is not translated to the frontpage URL (anymore) but just output as in plain text as part of the URL. Removing <front-page> from the code did resolve this and code below creates a working link to the forward service page.

'link' => 'forward?path=<encoded-query>',

Comments

#1

Using the latest stable version of forward and the link appear the same produced by its block, are you using the latest dev of Service Links core, or just updated Forward Services?

Could i see the website?

#2

I'm using the latest dev version of Service Links core module because of the additional functionality to change the title (which works just fine). I haven't checked the Forward Services integration with the latest stable Service Links module.
Unfortunately I can't show the website because this is on dev only and we will not push the Forward Services to the live site.

#3

Ok i loaded forward module and here http://servicelinks.altervista.org/?q=sample the link seem work (i am using the lastest dev of SL and the latest stable of Forward).

#4

I had the same problem with the dev release of SL. I replaced the forward mode with the latest stable version and it works fine now.
The link looks like:
    'link' => url('forward', array('absolute' => TRUE, 'query' => 'path=<encoded-query>')),

@The Crow
Your page uses the "?q=" URLs, where the link with ampersand might work. When using speaking URLs, the link is generated as http://domain.com/forward..., so it needs the question mark and the link code from the dev forward module does not work.

#5

@knut.drupal
thanks a lot now it's clear, when clean urls are active it need a ? otherwise work well as it is.

#6

Status:active» fixed

Committed a fix, if there are troubles, follow here, thanks.

#7

Status:fixed» closed (fixed)

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

#8

Status:closed (fixed)» active

Subscribing. After a flush of the theme registry, this actually appears to be fixed in the latest dev release.

#9

Status:active» closed (fixed)

apologies for reopening.

#10

concerning this issue the latest dev is also the last stable 2.1 ;)

#11

Version:6.x-2.x-dev» 6.x-2.1
Status:closed (fixed)» needs work

Still seeing this issue on the latest stable version of 6x-2.1 - normal forward module link is fine, service link button has a token in in for some reason...

#12

what token?

#13

Same here. The url generated is http://mydomain.com/<front-page>forward?path=node/130
Foward 6.x-1.20

#14

same issue here.

#15

Status:needs work» needs review

clean url enabled i guess

AttachmentSize
service_links-1272182.patch 590 bytes

#16

I had the <front-page> problem, and that patch fixed the problem for me. Thanks! :-)

#17

How do I apply the patch? Thanks.

#18

put the file .patch in the same directory of service_links.module and run this command from there:

patch -p0 < service_links-1272182.patch

patch.exe for windows: http://gnuwin32.sourceforge.net/packages/patch.htm

#19

Thanks for your quick response.

I have never applied patches before. So, please excuse my ignorance. I downloaded and installed the patch setup and sources on my desktop (local server). When I run the command as you mentioned, I get 'Patch is not recognized as an internal or external command,...' error.

Also, how do I do this on my live web server?

Thanks for your help.

#20

For apply the patch you need a software like patch (patch.exe under Windows) it run by command line (or MSDOS prompt under Windows).

Reading the error message you are probably working with Windows, so download and extract the package patch.zip i linked before and move the file patch.exe under the same directory of service_links.module.

Copy there also the file service_links-1272182.patch, through the Prompt run the following command (you have to be with the Prompt in the same path of service_links.module):

patch.exe -p0 < service_links-1272182.patch

either

patch.exe < service_links-1272182.patch

if everything works fine the file service_links.module has this new row:

$service['link'] = str_replace('<front-page>', $settings['subst']['front-page'], $service['link']);

so is ready to be uploaded in your website.

if you have a dedicated Linux server, you may run #18 using a program like Putty but don't forget to upload the file service_links-1272182.patch in the same directory of service_links.module.

#21

Status:needs review» reviewed & tested by the community

I was also having the problem where all my links were broken after the last update (they all took the form http://my-site.com/<front-page>forward) and this patch resolved the issue for me. Thanks :)

#22

Version:6.x-2.1» 6.x-2.x-dev
Status:reviewed & tested by the community» fixed

Pushed it!

#23

Status:fixed» needs work

Sorry to inform you that your patch misses a slash / when used in multilingual pages. The link looks:
hxxp://www.some_site_in_german.ch/deforward?path=node/523
Have a look close to .ch/deforward.
Did not test this with a single language site, but it works for a multilingual one.
Replace the line in the patch file with (note the concatenation ."/"):
$service['link'] = str_replace('', $settings['subst']['front-page'] . "/", $service['link']);

#24

Status:needs work» fixed

different problem, try this instead: #1350498: using forward and i18n: path prefix not correct

#25

Thank you.
Please allow me to mention that you reference to the Drupal 7 module. Will the above changes make it back to 6.x-2.x-dev or are they already applied?

#26

no not yet applied because looking for more testers... but the error is the same in both versions... in 6.x the row is #684 and the code to substitute is the same

#27

Status:fixed» closed (fixed)

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

#28

The same problem, with the patch works.

nobody click here