Page 1 of 3

[FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Tue Jun 06, 2006 7:08 pm
by conum
I have a lot of anchors () in my content (and static content) and much links (target1) to that anchors. Since updating to 1.0.9 these links don't work anymore. Instead of showing the "target1" the link is to the frontpage "www.xyz.de/index.php#target1"
What went wrong? In 1.0.7 and before everything worked as it should.

Re: Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Tue Jun 06, 2006 7:29 pm
by Robin
Hi,

I have tested with a clean install of Joomla! 1.0.9. stable and can confirm the issue. Will mark the topic as CONFIRMED. Still need to trace what is causing this.

Regards Robin

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 11:26 am
by tijs
Is there any work-around for this? I also have this issue and it is quite annoying!

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 12:27 pm
by Robin
Hi Tijs,

Still need to investigate the problem, so can't give you a workaround yet.

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Thu Jun 08, 2006 2:17 pm
by Dredd9799
As a workaround, I've gone into the mySQL database using PHPMyAdmin and inserted the relative URL for the page in front of the anchor.  So example becomes example.

The core code doesn't change it when you do it that way.  Not sure if this is the best workaround but from the viewpoint of my users, it's a fix.

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 2:31 pm
by conum
Dredd9799 wrote: As a workaround, I've gone into the mySQL database using PHPMyAdmin and inserted the relative URL for the page in front of the anchor.  So example becomes example.
The core code doesn't change it when you do it that way.  Not sure if this is the best workaround but from the viewpoint of my users, it's a fix.
I have about 30 static content items and some content items too, which I would have to change. But I don't want it. The code has to be changed, so that it works like before!

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 2:51 pm
by tijs
The point being, it is better practice to have relative links than absolute ones in case the URL changes later on. For now I just put the full absolute URL in front of the #link but obviously it would be better if we can keep using relative links.

t.

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 4:29 pm
by havshoei
Hi

I have done some investigation with SEF on and it seems that the error is in ‘mambots/content/mossef.php’, the reason is that the call to sefRelToAbs() do not include information about the current page.

A possible solution could be:

Replace line 76

Code: Select all

	$link 		= sefRelToAbs( $matches[1] );
With:

Code: Select all

	if ( substr($matches[1],0,1) == '#' ) {
		// anchor
		$temp 	= split('index.php', $_SERVER['REQUEST_URI']);
		$link 	= sefRelToAbs( 'index.php' . @$temp[1]);
		$link	= $link .  $matches[1];
	} else {
		$link 	= sefRelToAbs( $matches[1] );
	}
This seems to solve the problem.

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 4:31 pm
by conum
I don't know, if that help in my case, as I don't use SEF  :(

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 5:02 pm
by havshoei
Hi again

Try unpublish the SEF manbot, ther is a bug in it that do not stop it from running if SEF is disablet.

Or uncomment lines 34 to 36 in 'mambot/content/mossef.php'

Change lines 34 to 36 from

Code: Select all

	//if ( !$mosConfig_sef ) {
	//	return true;
	//}

to

Code: Select all

	if ( !$mosConfig_sef ) {
		return true;
	}

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Thu Jun 08, 2006 8:59 pm
by conum
I unpublished the sef-mambot and my jumps to anchors work again. Thanks a lot.
I don't know, what this means, as I never used SEF and I don't know, why it was published :o

Re: [CONFIRMED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Mon Jun 12, 2006 6:15 am
by danimal
At first i thought it was Open-SEF, but after upgrading now, turning open sef off and just using standard Joomla SEF, I can see that Joomla is definitely the problem.

I have tried numerous fixes posted on here (including the ones above) and the open-sef forum.

anchors only seem to be working properly on the front page,
any other page it will just jump to the front page.

Anyone figure this out?

On this page, it uses a moo-fx nav, on the front page the nav panels slide open no problem. and the top button works
http://patrickmeuser.net/index.php

On this page if you try to use the nav it will just shoot you back to home.
http://patrickmeuser.net/content/view/1/2/

Re: [CONFIRMED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Mon Jun 12, 2006 8:10 am
by havshoei
It seems to me that it is within a menu module you are using references to page anchors (e.g. href="#foo").

To do this you must create a "Links -- url" menu item (e.g. index.php?option=com_content&task=view&id=1&Itemid=2#foo).

The Joomla function resposible for the translation of internal links to SEF links requires the "index.php?option..." part, otherwise it wil just set the link to "#foo", and the html tag "" redirects you to the frontpage.

The problem in this thread, is page anchors within a single content item do not work, because the "index.php?option..." part do not get set by the sef-bot.

Re: [CONFIRMED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Mon Jun 12, 2006 8:40 am
by danimal
havshoei wrote: It seems to me that it is within a menu module you are using references to page anchors (e.g. href="#foo").

To do this you must create a "Links -- url" menu item (e.g. index.php?option=com_content&task=view&id=1&Itemid=2#foo).

The Joomla function resposible for the translation of internal links to SEF links requires the "index.php?option..." part, otherwise it wil just set the link to "#foo", and the html tag "" redirects you to the frontpage.

The problem in this thread, is page anchors within a single content item do not work, because the "index.php?option..." part do not get set by the sef-bot.



thanks, but that is not a module, it is a menu hard coded into my template. and this IS an achor problem nothing more.
thanks for the help though.

Re: [CONFIRMED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Mon Jun 12, 2006 11:12 am
by matt
havshoei's suggested fix didn't work for me with SEF on and 404SEF... A proper work around would be much appreciated.

Thanks

Matt

P.s: I mainly have issues with content pages with href links all over the place.

Re: [CONFIRMED/UNDER REVIEW] Links to anchor don't work after 1.0.7 to 1.0.9 upd

Posted: Tue Jun 13, 2006 8:45 am
by sagemaniac
havshoei wrote: ...
A possible solution could be:

Replace line 76
...
Thanks - fixed it for me...

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Wed Jun 14, 2006 9:21 am
by matt
After further testing on havshoei's hack, I can confirm that it works on content pages! The reason why I reported it not working is that JamboReport's hrefs still don't work. But that can be related to the component.

Thanks a lot havshoei for sharing with us your finding.

Matt

Hyperlinked Footnotes

Posted: Wed Jun 14, 2006 6:26 pm
by sural98
Quote
I have added a text with hyperlinked footnotes into http://localhost/site. The hyperlinks are relative to the text. eg

[1]

The problem is that this hyperlink points to http://localhost/site/#_ftn1. The content related section of the address is stripped out.
What would be the problem?
Any help will strongly be appreciated because I was about to publish the site. It is postponed because of this problem now.
Thanks.

I had experienced this problem in 1.0.9 stable. I have replaced the current files with 1.0.8 and the problem is over now. That is the hyperlinked footnotes point to the correct paths now.
I do not know what in 1.0.9 caused this problem.

Re: Hyperlinked Footnotes

Posted: Wed Jun 14, 2006 7:12 pm
by conum

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Thu Jun 15, 2006 7:48 am
by sural98
Better is to wait for a fix by the Joomla Team. Workarounds may cause other problems.

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Thu Jun 15, 2006 7:54 am
by danimal
sural98 wrote: Better is to wait for a fix by the Joomla Team. Workarounds may cause other problems.
I agree, I willl just sit patiently until this gets worked out.

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Thu Jun 15, 2006 11:35 pm
by eric
I'd be interested in hearing some type of response.. can't upgrade until there is a solution.  (and I'm running an old version)

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Fri Jun 16, 2006 6:23 am
by Robin
Hi All,

We are looking at it, but with a long list of reports it's taking some time for us to gather all info and get an overview. It's under our attention and as soon as we have found the real problem a possible fix will also be posted.

Thanks for your patience, regards Robin

Re: [ON TRACKER] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Fri Jun 16, 2006 5:20 pm
by stingrey
Fixed in SVN

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Fri Jun 16, 2006 5:23 pm
by stingrey
The modified /mambots/content/mossef.php file in SVN attached.

Please note that the actual file in SVN is subject to change at anytime and the attached file may differ from the final version in the next release.
Use with caution.
No official support is provided for its use

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Fri Jun 16, 2006 6:45 pm
by Cocoony
:D Great! It works! Thanks for the efforts.

Regards,
Peter

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Sat Jun 17, 2006 1:26 pm
by danimal
woooo!

thanks, downloading now!

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Sun Jun 18, 2006 3:07 pm
by danimal
I installed the fix and it still doesn't work. with core joomla sef or open sef.
i believe this had to do with anchors within content items. my problem is all my anchors redirect me to the home page. they will work on the home page though.

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Sun Jun 18, 2006 6:21 pm
by Robin
Hi danimal.

I just tested the fix myself, it restores anchors in content from redirecting to frontpage. The anchors are working for me again. You might try another ftp client, or at least check if the new file has been uploaded correctly. To make sure 100%, delete it first from your webserver, then upload the new, this will prevent any errors.

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Posted: Sun Jun 18, 2006 6:36 pm
by danimal
RobInk wrote: Hi danimal.

I just tested the fix myself, it restores anchors in content from redirecting to frontpage. The anchors are working for me again. You might try another ftp client, or at least check if the new file has been uploaded correctly. To make sure 100%, delete it first from your webserver, then upload the new, this will prevent any errors.
I did it again just to humour myself and no,  it does not work.