Keyword

Parameters in URL give Error 0 Using $this when not in object context

  • Fábio Jordan
  • Fábio Jordan's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 5 months ago #170274 by Fábio Jordan
Hi.

I have noticed that when I add parameters in my URL (and also when a link from other website, like Facebook, insert parameters), my website give me the following error:
0 Using $this when not in object context

Look that:
www.cafecomfilme.com.br/criticas/critica-do-filme-bohemian-rhapsody?fbclid=IwAR1D3F9E6vZvQZrrBYcFMQq9rCUCeBOobHgvIFhsRC9aFz41vW15HD9riCE

The same page works fine if I remove the parameters from Facebook:
www.cafecomfilme.com.br/criticas/critica-do-filme-bohemian-rhapsody

Ok, I can remove the parameters manually, but my user won't have a clue what to do and will leave the website.

So, anyone have a hint to fix this?

Thanks in advance!

Best regards!

Please Log in or Create an account to join the conversation.

  • Fábio Jordan
  • Fábio Jordan's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 5 months ago #170275 by Fábio Jordan
By the way, I'm using:
Joomla 3.8.12
K2 2.9
Modules from K2
K2 BNR
XT Link for K2
Gavick template

Just noticed that this error only happens in articles, in categories, the parameters works fine:
www.cafecomfilme.com.br/criticas?facebook
www.cafecomfilme.com.br/criticas

Is there something to do with a code in my override files?

Thanks again!

Please Log in or Create an account to join the conversation.

  • Fábio Jordan
  • Fábio Jordan's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 5 months ago #170277 by Fábio Jordan
Ok, I guess I solved it.

I had this piece of code to avoid duplicate URLs in my website and also to collect only the original URL:
<?php
if ($this->item->link!= JRequest::getURI()) JApplication::redirect($this->item->link,'','' ,true);
?>

It was the first thing in my item.php. I just removed it and now parameters are working.

Well, if anyone has the same problem, there's the solution.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #170288 by JoomlaWorks
Something's probably changed in the Joomla API calls you use in Joomla 3.9.0.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum