Components Anywhere

Component not displaied. Went throught the FAQs and tutorials but can't get it to work.

1 year 8 months ago #69037

oloccina's Avatar oloccina

Hi,
I ma trying to display

Confidential information:
(hidden)


into an article using this sintax:
{component index.php?option=com_uam&view=uam&Itemid=168}

but I alwayg get this error:
<!-- Components Anywhere Message: The component cannot be placed because an invalid URL is given or the page timed out. -->

I went through your FAQs but everything seems ok. At first I was unsure about cURL, but I am using cURL with chronoforms to subscribe users to an acymailing list and it's working. I don't have any cache or firewall in place, and the component url is working when tested directly.

Thank you!

1 year 8 months ago #69038

Peter van Westen's Avatar Peter van Westen Admin

You had html tags messing up the url.
In the html view of the editor it looked like:

<p>{component <span style="background-color: transparent;">index.php?option=com_uam&amp;view=uam&amp;Itemid=168</span>}</p>
I removed that span and now it works.

When copy/pasting code, always paste as plain text. Or copy/paste via a simple text editor (like notepad).

1 year 8 months ago #69039

oloccina's Avatar oloccina

Thanks!
Sorry, should have thought of that, I always make things more complicated than they are :-P

1 year 7 months ago #69362

Accademia  Domani's Avatar Accademia Domani

Hello i got the same problem on my site

www.accademiadomani.it

can you help me?

i got 2 components anywhere object on my homepage but they don't show anything

<div>{{componente index.php?option=com_zoo&amp;view=category&amp;layout=category&amp;Itemid=150}}</div>

1 year 7 months ago #69363

Peter van Westen's Avatar Peter van Westen Admin

You website is blocking the connection:

403: Access Forbidden
Your location (NL) has been blacklisted.

1 year 7 months ago #69364

Accademia  Domani's Avatar Accademia Domani

sorry now you are not blacklisted

1 year 7 months ago #69365

Peter van Westen's Avatar Peter van Westen Admin

It seems to be timing out.
Can you give me (super) admin and (s)ftp access so I can take a look?
You can use the 'Hidden text' button in the forum editor to hide the confidential information.

1 year 7 months ago #69366

Accademia  Domani's Avatar Accademia Domani

Confidential information:
(hidden)


tnxs!

1 year 7 months ago #69367

Peter van Westen's Avatar Peter van Westen Admin

It seems there is an issue with your server using the curl functionality.
This is the error it stops with:

Operation timed out after 5001 milliseconds with 0 bytes received
Please ask your host about this.

1 year 7 months ago #69368

Accademia  Domani's Avatar Accademia Domani

how can i be more explicit with the problem? i tryed to get the page using this code

function get_data($url) {
	$ch = curl_init();
	$timeout = 5;
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	$data = curl_exec($ch);
	curl_close($ch);
	return $data;
}


echo get_data('http://www.accademiadomani.it/index.php?option=com_zoo&amp;view=category&amp;layout=category&amp;Itemid=150');


and everything is ok

1 year 7 months ago #69369

Accademia  Domani's Avatar Accademia Domani

this is also very strange cause, if i try to get the page using a browser with clean cache there's no problem

1 year 7 months ago #69370

Accademia  Domani's Avatar Accademia Domani

i've asked my host about curl and he answer that no change has been made recently

1 year 7 months ago #69371

Peter van Westen's Avatar Peter van Westen Admin

Components Anywhere also passes on any set cookies to the curl functionality (as some components rely on that).
It seems your sever goes haywire when these are set:

curl_setopt($ch, CURLOPT_COOKIE, implode(';', $cookies));
The value of the $cookies (when testing):
Array
(
    [0] => e7a7be592dfa25ec98cedcdf583b093a=0puc8o0pukocj5ekv7utpf3e13
    [1] => 63a6fdd11b53c669df291c44b92314f6=iff2b6jm19uh420un2ip12gr04
)

1 year 7 months ago #69374

Accademia  Domani's Avatar Accademia Domani

where can i find that line of code?

1 year 7 months ago #69375

Peter van Westen's Avatar Peter van Westen Admin

plugins/system/componentsanywhere/src/Curl.php

1 year 7 months ago #69376

Peter van Westen's Avatar Peter van Westen Admin

Please try the latest development version from:
www.regularlabs.com/development-releases

I have added an option to pass on the cookies to the component (off by default).

1 year 7 months ago #69377

Accademia  Domani's Avatar Accademia Domani

i commented the line, i will test the new release when it will be out because i'm on a production site
tnxs!

1 year 7 months ago #69378

Peter van Westen's Avatar Peter van Westen Admin

ok.

11 months 3 days ago #76212

Sandra Di Carlo's Avatar Sandra Di Carlo

same error but disabling cookies does not resolve app51.it/brand/pyrex

11 months 3 days ago #76213

Peter van Westen's Avatar Peter van Westen Admin

What exact same error do you have?