Joomla 3.7 a tag href failure

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Joomla 3.7 a tag href failure

Post by ssailow » Thu Apr 27, 2017 8:38 pm

Forum:

Now that I have updated to Joomla 3.7, internal links are formed incorrectly, with no change in the code on my end.

Here is the code for an internal link on the home page (redthruviolet.com/ACGSR):

<A class="LinkExt" href="index.php?option=com_content&view=article&id=50"> Felines</A>

This generates a link pointing to Article 50, in Joomla 3.6.5.

However, in Joomla 3.7, the internal "option=com_content&view=article&" is stripped out, and we get:

<A class="LinkExt" href="/ACGSR/index.php?id=50"> Felines</A>

If you click on the above, you go to the Home Page, no matter what id it is.

I tried to find information on this in the Release Notes for 3.7, but got nowhere.

Help!

:Susan Sailow
Red thru Violet Web Site Works

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sat Apr 29, 2017 4:35 am

I changed the Search Engine Friendly URLs to "No", and now this is what I get:

http://redthruviolet.com/ACGSR/index.ph ... Itemid=101

That is, the link is there, but Joomla has added "&itemid=101".
Red thru Violet Web Site Works

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: Joomla 3.7 a tag href failure

Post by leolam » Sat Apr 29, 2017 5:44 am

I do not get the link with the added itemid=101. I do get proper "http://redthruviolet.com/ACGSR/index.ph ... icle&id=50" both in the top-left menu and in the bottom menu
violet.jpg
Leo 8)
You do not have the required permissions to view the files attached to this post.
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sat Apr 29, 2017 6:33 pm

Leo:

Thank you for checking.
My apologies for not pinpointing the link.
The links that are formed by javaScript are OK, which are the ones you looked at.
The links that are not forming correctly are embedded in the HTML of the Article.

There are 3 columns - if you go to the rightmost column, scroll down, and find the area below the little pictures of the dogs that reads:

For more detail on them, and more animals,
go to either the Felines or Canines page.

Mouse over the Felines link, and you will see what I mean.

I turned the SEF back on, so you will not see the itemid=101, you will only see the link that has code removed.

:Susan
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sat Apr 29, 2017 7:39 pm

I see what you mean:
ACGSR1.png
The URL "http://redthruviolet.com/ACGSR/index.php?id=50" means "go to the home page of the website and pass the parameter 'id=50' to the 'index.php' file"; the problem is that 'index.php' doesn't know what to do with that "parameter".

The fault is caused by the incorrect URL within the module that you're displaying in the "third column". It doesn't look to be a problem caused by J! 3.7.0 specifically (but I have no knowlege of what was contained in that module before you upgraded). My guess is that the link was broken before you updated to J! 3.7.0, anyway (but I could be wrong). The fix is to correct the existing link.
You do not have the required permissions to view the files attached to this post.

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sat Apr 29, 2017 8:53 pm

Sozzled:

In the first post, I showed the HTML link code, and continued:

<A class="LinkExt" href="index.php?option=com_content&view=article&id=50"> Felines</A>

This generates a link pointing to Article 50, in Joomla 3.6.5.

However, in Joomla 3.7, the internal "option=com_content&view=article&" is stripped out, and we get:

<A class="LinkExt" href="/ACGSR/index.php?id=50"> Felines</A>

The link was not broken, and other, similar links have the same problem.

:Susan
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sat Apr 29, 2017 8:57 pm

The first link

Code: Select all

<A class="LinkExt" href="index.php?option=com_content&view=article&id=50"> Felines</A>
is correct.

The second link you mention

Code: Select all

<A class="LinkExt" href="/ACGSR/index.php?id=50"> Felines</A>
is incorrect (for the reason I indicated in my earlier post).

I cannot explain how it came to be that you have a link (or links) that is/are incorrect (i.e. whether they were created, modified or generated by J! 3.7.0). My suggestion is to fix the faulty links. Does this make sense and can you do that?

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sat Apr 29, 2017 9:08 pm

Sozzled:

The links are correct in the HTML of the article.
Joomla 3.7 is removing part of the link code, and creating a disfunctional link.

:Susan
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sat Apr 29, 2017 9:21 pm

ssailow wrote:The links are correct in the HTML of the article.
Joomla 3.7 is removing part of the link code, and creating a dysfunctional link.
I tested this myself in a "vanilla-flavoured" J! 3.7.0 website.

I modified an existing article using two different WYSIWYG editors and added a link to a menu. The resultant link, using this approach was slightly different depending on the WYSIWYG editor I used. Using TinyMCE, the link was

Code: Select all

/index.php?Itemid=xxx
Using JCE, the link was

Code: Select all

/index.php?option=com_content&view=category&id=y&Itemid=xxx
Note, the significance of the parameter Itemid=xxx, not id=y (as you have in your case). Perhaps it's a case of something removing part of the URL but I don't know what it is that's done this.

I can only conclude that there's something peculiar to your situation that may (or may not) be related to J! 3.7.0 (or to something else, perhaps), that you may need to further investigate.

When you wrote that "the link(s) are correct in the HTML of the article", when you examine the underlying HTML—before, during and after saving the article text—what's actually in those links?

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sat Apr 29, 2017 9:51 pm

Sozzled:

I do not use an editor.

Here is the column code, in the Article:

<TD>
For more detail on them, and more animals,
<BR /> go to either the <A class="LinkExt" href="index.php?option=com_content&view=article&id=50"> Felines</A> or <A class="LinkExt" href="index.php?option=com_content&view=article&id=52"> Canines</A> page.
</TD>

Once a person launches the page, this is the code that is shown:

<TD>
For more detail on them, and more animals,
<BR /> go to either the <A class="LinkExt" href="/ACGSR/index.php?id=50"> Felines</A> or <A class="LinkExt" href="/ACGSR/index.php?id=52"> Canines</A> page.
</TD>

Joomla 3.7 is stripping out the "option=com_content&view=article&".

This did not happen in Joomla 3.6.5.
It now happens in Joomla 3.7.

:Susan
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sat Apr 29, 2017 10:49 pm

ssailow wrote:I do not use an editor.
I'm sorry but I don't understand. What do you mean that you "do not use an editor"?

How did you create these parts of your website (highlighted in yellow the following image) all of which show invalid links (highlighted in magenta):
ACGSR2.png
These parts didn't materialise of their own accord. What process did you use to create those tables and, if you didn't use an editor, how can you support your theory that the underlying links were modified by J! 3.7.0?

I'm not challenging what you've written; I'm just trying to understand how you got to where you're now at.
You do not have the required permissions to view the files attached to this post.

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sat Apr 29, 2017 11:43 pm

By the way, although there are a couple of ways people can access your "felines" page

e.g.

1) (from the menu item that has the correct link) http://redthruviolet.com/ACGSR/index.ph ... icle&id=50 ; and

2) if someone literally types http://redthruviolet.com/ACGSR/index.ph ... icle&id=50 into the address line of the browser

there are a couple of observations I would like to make:

a) it's possible that J! 3.7.0 somehow translates the link within an article by stripping out the "option=com_content&view=article&" part and leaving only "?id=50" (in your case). So I tried to reproduce this on my test website. I modified a test article on my website to use the URL "/index.php?option=com_content&view=article&id=x" (where x was a valid article "id") and it worked, without problems.

b) it's possible that you're using some kind of SEO feature that I'm unaware of that modifies the URLs on your website and that this SEO feature is incompatible with (or not suitable for) J! 3.7.0.

Guesswork on my part. If it would be of any help, you may PM me and we could take this matter offline for a bit and explore what may be the cause of your current problem. Mystifying to me. :geek:

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sun Apr 30, 2017 4:25 am

Hello, again.

When I say I don't use an editor, I mean that, for my User, I assign "Editor - None" to it.
That is, I don't use an editor while logged into Joomla.
I hand code.

I am not using any special anything for links or SEF links.

Since you tried it and it worked for you, I'll try reentering the code, and see what happens.

Thank you for your attention to this matter.
If you think of anything else, please let me know.

As I said, all worked fine in Joomla 3.6.5, then I updated to 3.7 (making NO code changes), and, whammo!

.Susan
Red thru Violet Web Site Works

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Sun Apr 30, 2017 4:58 am

An update:

I tried some experiments:

2: Coded "&" rather than "&" in the link

<A class="LinkExt" href="index.php?option=com_content&view=article&id=50">

3: Echoing via php, the code "option=....." that is stripped out

<A class="LinkExt" href="index.php?<?php echo 'option=com_content&view=article&'; ?>id=50"> Felines</A>

4: Inserting the web site url in front of index.php

<A class="LinkExt" href="http://redthruviolet.com/ACGSR/index.ph ... icle&id=50"> Felines</A>

2 and 3 produced the same, incorrect links.

4 produces a correct link.

Seems to me that I should not have to do that inserting.
It's all over the web site.
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Sun Apr 30, 2017 11:31 pm

I'm pleased to see that you seemed to have found a workaround for your current problem.

Whether this problem was caused specifically as the result of upgrading to J! 3.7.0 is not something that I am aware of.

One point that I would like to make is that the URL "format" you employed in hand-crafting your <a href=" " ...> statements, viz.

Code: Select all

index.php?option=com_content&view=article&id=50
is not valid HTML.

The HTML entity code (i.e. &) is invalid within the URL (as a mechanism for "stringing together" parameters to be passed to the backend [CGI] process handler. Perhaps it's a matter of conjecture that some CGI process handles will tolerate the use of HTML entity codes but, for the purposes of passing parameters, it's not a good idea to deviate from the accepted principles that apply.

In other words, while it's possible that a URL syntax written as

Code: Select all

index.php?option=com_content&view=article&id=50
might be interpreted as

Code: Select all

index.php?option=com_content&view=article&id=50
it's not a "sure thing".

Although I haven't tested both usages on any of my test sites—I'm not accustomed to writing "invalid HTML"—perhaps it's something that someone else might have an academic interest in pursuing. The point that I want to make here is that the topic we've been discussing here is an example of the pitfalls in "hand-crafting" URLs instead of using more "automatic" mechanisms such as those used with WYSIWYG editors. That's not to say that you necessarily did anything wrong before you updated your website to J! 3.7.0—and I can't say for sure whether there has been something new added to J! 3.7.0 that now "strips out" invalid HTML that the PHP interpreter may encounter or, indeed if this is something else that's occurred as a by-product of the update—but it does suggest that you might have been "getting away with" using invalid HTML and now these factors have been brought "out into the open".

Again, I'm pleased to see that you've identified the cause, you've identified a method to address the problem—albeit at additional and "unnecessary" additional cost in time and inconvenience to you—and you're able to move on. 8)

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Tue Jul 01, 2008 10:56 pm

Re: Joomla 3.7 a tag href failure

Post by ssailow » Mon May 01, 2017 1:07 am

Sozzled:

Thanks for your post.

In my Test 2, I did use & instead of & in the link code, with the same result.

Since the only difference is the update to Joomla 3.7, it looks to me like perhaps one of the Joomla programs (routing?) is stripping out things now, which it did not do before.

If I ever help with Joomla coding, I would aim for making things backwards compatible as much as possible.
Otherwise, you end up with unhappy developers, like me.

I've lost Dreamweaver to Adobe's business practices, but I'll try to do more validating, so that my HTML is more correct.

:Susan
Red thru Violet Web Site Works

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla 3.7 a tag href failure

Post by sozzled » Mon May 01, 2017 6:06 am

I'm still unsure if there was something included in J! 3.7 that affects Joomla's routing or why, in your case, certain elements of the URLs used in some of your links are being stripped. I notice there is a mention of a change—the full extent of which, I thought, was being deferred until J! 3.8—referenced in the J! 3.7 release information, specifically, GitHub #8256. You, and others, might like to continue the commentary on that if that's something that interests people.

However, I think we should clarify that there's a difference between using the relative URL you've described in your test case "2", viz.

Code: Select all

<a class="LinkExt" href="index.php?option=com_content&view=article&id=50">Felines</a>
and the absolute URL used in your test case "4", viz.

Code: Select all

<a class="LinkExt" href="http://redthruviolet.com/ACGSR/index.php?option=com_content&view=article&id=50"> Felines</a>
A refresher on the difference between absolute and relative URLs might be worth examination.

You will see that there could be a world of difference between a relative URL written as

Code: Select all

href="index.php?option=com_content&view=article&id=50"
and one written as

Code: Select all

href="/index.php?option=com_content&view=article&id=50"
In the second of these two examples, the relative reference should be parsed identically to what you've written in your test case "4". Perhaps that's something you might like to try?

This doesn't necessarily explain why (in your case), because of the way you hand-crafted the relative URL in internal site links, parts of those URLs were "removed". Nor does it definitely eliminate the possibility that something was included in J! 3.7 that invalided your [previously working] internal site links; however, it may explain why the links weren't going where you intended for them to go or why your tests failed.

Stejin Stephen
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Apr 09, 2018 9:04 am

Re: Joomla 3.7 a tag href failure

Post by Stejin Stephen » Mon Apr 09, 2018 9:29 am

@ssailow:

Can you please try the following & let me know your feedback?

Login to your Joomla administrator.
Go to Content -> Articles.
Click the "Options" button.
Click the "Integration" tab.
Try changing "URL Routing" setting.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9744
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Joomla 3.7 a tag href failure

Post by AMurray » Tue Apr 10, 2018 9:30 am

Note this post is OLD (the OP posted the question 12 months ago, and last response was May 2017...nothing since.) I doubt the OP is still around with the trouble (surely sorted out after 12 months)and refers to an old version of Joomla (3.7.x).

;) ;)
Regards - A Murray
General Support Moderator


Locked

Return to “General Questions/New to Joomla! 3.x”