New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Piwik 2.9.1 Array to string conversion in TrackerCodeGenerator.php #7273
Comments
Hi @mouyse thanks for the report. I can't reproduce this bug. Can you explain how to reproduce this? do you use any custom plugin maybe? |
I am trying to get a tracking code using SitesManager.getJavascriptTag method. After calling it, I receive the above code plus the response like below: <div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
<strong>There is an error. Please report the message (Piwik 2.9.1)
and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
Notice:</strong> <em>Array to string conversion</em> in <strong>/home/user/public_html/piwik/core/Tracker/TrackerCodeGenerator.php</strong> on line <strong>137</strong>
<br /><br />Backtrace --><div style="font-family:Courier;font-size:10pt"><br />
#0 Piwik\Error::errorHandler(...) called at [:]<br />
#1 str_replace(...) called at [/home/user/public_html/piwik/core/Tracker/TrackerCodeGenerator.php:137]<br />
#2 Piwik\Tracker\TrackerCodeGenerator->generate(...) called at [/home/user/public_html/piwik/plugins/SitesManager/API.php:93]<br />
#3 Piwik\Plugins\SitesManager\API->getJavascriptTag(...) called at [:]<br />
#4 call_user_func_array(...) called at [/home/user/public_html/piwik/core/API/Proxy.php:211]<br />
#5 Piwik\API\Proxy->call(...) called at [/home/user/public_html/piwik/core/API/Request.php:216]<br />
#6 Piwik\API\Request->process(...) called at [/home /user/public_html/piwik/plugins/API/Controller.php:33]<br />
#7 Piwik\Plugins\API\Controller->index(...) called at [:]<br />
#8 call_user_func_array(...) called at [/home/user/public_html/piwik/core/FrontController.php:582]<br />
#9 Piwik\FrontController->doDispatch(...) called at [/home/user/public_html/piwik/core/FrontController.php:96]<br />
#10 Piwik\FrontController->dispatch(...) called at [/home/user/public_html/piwik/core/dispatch.php:36]<br />
#11 require_once(...) called at [/home/user/public_html/piwik/index.php:46]<br />
</div><br />
</pre></div>
<br />
<?xml version="1.0" encoding="utf-8" ?>
<result>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
.....
.....
....
...
...
..
.
<!-- End Piwik Code -->
</result> |
Can you let us know how you call it? I presume you are using the API? Can you maybe post the URL that you to use here? Do not forget to remove the parameter |
Yes, I am using the API. $p['module'] = "API";
$p['format'] = "xml";
$p['method'] = "SitesManager.getJavascriptTag";
$p['idSite'] = SITEID;
$url = "http://analytics.connectedforlife.in/index.php?" . http_build_query($p);
$url .= "&token_auth=TOKEN_AUTH";
$fetch_data = file_get_contents($url); This is the final url: http://analytics.connectedforlife.in/index.php?module=API&method=SitesManager.getJavascriptTag&format=xml&url=http%3A%2F%2Fwww.xxxxxxx.com&idSite%5B0%5D=10&token_auth=xxxxxxxxxxxxxxxxxxxxxxx |
@mouyse can you reproduce this in 2.12.1, or on the Piwik demo? it seems to work there: http://demo.piwik.org/index.php?module=API&method=SitesManager.getJavascriptTag&format=xml&url=http%3A%2F%2Fwww.xxxxxxx.com&idSite[0]=3&token_auth= |
please re-open if you can reproduce, we will fix it |
Reported at piwik forum also:
http://forum.piwik.org/read.php?2,124494
Notice: Array to string conversion in /home/user/public_html/piwik/core/Tracker/TrackerCodeGenerator.php on line 137
Backtrace -->
#0 Piwik\Error::errorHandler(...) called at [:]
#1 str_replace(...) called at [/home/user/public_html/piwik/core/Tracker/TrackerCodeGenerator.php:137]
#2 Piwik\Tracker\TrackerCodeGenerator->generate(...) called at [/home/user/public_html/piwik/plugins/SitesManager/API.php:93]
#3 Piwik\Plugins\SitesManager\API->getJavascriptTag(...) called at [:]
#4 call_user_func_array(...) called at [/home/user/public_html/piwik/core/API/Proxy.php:211]
#5 Piwik\API\Proxy->call(...) called at [/home/user/public_html/piwik/core/API/Request.php:216]
#6 Piwik\API\Request->process(...) called at [/home /user/public_html/piwik/plugins/API/Controller.php:33]
#7 Piwik\Plugins\API\Controller->index(...) called at [:]
#8 call_user_func_array(...) called at [/home/user/public_html/piwik/core/FrontController.php:582]
#9 Piwik\FrontController->doDispatch(...) called at [/home/user/public_html/piwik/core/FrontController.php:96]
#10 Piwik\FrontController->dispatch(...) called at [/home/user/public_html/piwik/core/dispatch.php:36]
#11 require_once(...) called at [/home/user/public_html/piwik/index.php:46]
The text was updated successfully, but these errors were encountered: