All anchor tags included in the URL field convert on output from "#" to "%23".
Happens after upgrading from Link 7.x-1.3 to 7.x-1.4.
Anchor tags work fine with 7.x-1.3

Comments

Bodigiti created an issue. See original summary.

Erik Hendrick’s picture

Title: Anchor Tags "#" are Converted to %23 after Upgrade to from 1.3 to v1.4 » Anchor Tags "#" are Converted to %23 after Upgrade from 1.3 to v1.4
m.attar’s picture

Quick solution using function hook_url_outbound_alter()

/*
 *hook_url_outbound_alter()
 */
function MODULENAME_url_outbound_alter(&$path, &$options, $original_path){
    
    if($path == 'PATHWITH#') {
         $pathExploded = explode('#', $path);
         list($path, $options['fragment']) = $pathExploded;
    }
}

You can apply the following solution for all paths contains fragment:

/*
 *hook_url_outbound_alter()
 */
function MODULENAME_url_outbound_alter(&$path, &$options, $original_path){
    
  if(strpos($path, '#') !== false) {
         $pathExploded = explode('#', $path);
         list($path, $options['fragment']) = $pathExploded;
    }
}

Regards

Idas’s picture

Same problem for me.

Idas’s picture

Priority: Normal » Major
mikeparker’s picture

Hi,

I've noticed that this issue has been here for 9 months+ and, due to a number of clients using this module, am keen to help out fixing the issue.

Looking at #3 above, can anyone see why this might not work, not be the way to go? Thought I'd ask before starting work on a fix.

M

caschbre’s picture

@mikeparker I'm currently using #3 in my own custom module and so far it's working well. Doesn't necessarily fix the issue in the module, but it keeps the projects rolling.

jlongbottom’s picture

#3 works for me, though it seems to roll back all the time until I clear caches a few times.

This is a bit absurd it has not been fixed after so long. Is it working in dev at least?

RenatoG’s picture

Issue tags: +ciandt-contrib

Hi people, how are you?

The error continues for you?

If yes, can provide me a link of example (URL), please?

I make a test here on the dev version and it works fine for me.

Thank you very much people.

Good Work and Good Weekend.

Regards.

RenatoG’s picture

Assigned: Unassigned » RenatoG
Status: Active » Fixed

Hi people.

Apparently it was resolved in the dev version.

I'm closing for now. If anyone has this problem please let us know.

Good Work and Good Week.

Regards.

jlongbottom’s picture

I was mostly wondering when this fix will be in the stable release? I don't like using dev versions of modules in production.

RenatoG’s picture

I agree with you @jlongbottom.

I will create the planning a new release as soon as possible.

Thank you very much for feedback.

RenatoG’s picture

Created task with plan.

#2889744: New release

Good Work and Good Week.

Regards.

brunorios1’s picture

Still not working in the dev version.

Status: Fixed » Closed (fixed)

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

haleagar’s picture

Confirmed not working in Dev or 7.x-1.5-beta2

RenatoG
Specifically this effects a URL which contains only a fragment e.g the full url entered is "#anchor"