Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Overlay doesn't work with this module.
Comment | File | Size | Author |
---|---|---|---|
#1 | i1890136.patch | 1.33 KB | attiks |
Comments
Comment #1
attiks CreditAttribution: attiks commentedComment #2
hass CreditAttribution: hass commentedHow have you been able to save a non-integer in the admin form? There is a validation that requires integers only. Otherwise you cannot use Piwik.
See http://drupalcode.org/project/piwik.git/blob/refs/heads/7.x-2.x:/piwik.a...
I'm not sure what all this stuff has to do with "Overlay" or what this exactly means.
Comment #3
attiks CreditAttribution: attiks commentedThe problem is that for Drupal it is a string, not an integer, and it was outputted to JavaScript as a string, inside piwik they check using !== siteId against a number, which always fails because it's compared against a string without this patch.
To test the new overlay from piwik, install the latest version
Comment #4
soulfroysI backported this patch to version 6, but no success... humf!
Comment #5
hass CreditAttribution: hass commentedThis means that http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_json_encode/7 may has a bug. It's just an integer and drupal_json_encode() makes it an string. Than we should better fix drupal_json_encode(). What PHP versions are you using? Just to find out of this may an issue of http://php.net/json_encode or the the drupal json helper.
Maybe better if the piwik guys will change
!==
to!=
.Comment #6
attiks CreditAttribution: attiks commentedI don't think so:
drush ev "print drupal_json_encode(variable_get('piwik_site_id', ''));"
will print "1" because variable_get will return a string.FYI:
drush ev "print drupal_json_encode(123);"
will print 123Comment #7
soulfroysOh boy... after 100 attempts and settings, then realized I made a classic mistake: always check the simple things first, ie, "the script is being inserted into the footer?". No!! What!! Then I inserted the "Standard JavaScript Tracking code" manually and ... voilà, it worked!
But ... my Piwik works normally without the code, all the statistics are there. So I wonder, what is wrong? This is not the right solution, since apparently the statistics are computed twice ... Any idea?
Piwik hook_footer:
Comment #8
hass CreditAttribution: hass commentedThis is a D7 case. Please do not highjack the case with unrelated issues.
Comment #9
haggins CreditAttribution: haggins commentedAccording to the issue title, I seem to have the same problem as #7. When I try to open the page overlay (in Piwik) I get the following error:
The Page Overlay session couldn't be launched yet.
Maybe the page loaded on the right doesn't have the Piwik tracker code. In this case, try launching Overlay for a different page from the pages report.
Piwik FAQ lists some solutions: http://piwik.org/docs/page-overlay/#toc-page-overlay-troubleshooting
However, none of them fit my case. I'm using http and the (actual) tracking code is present in the footer.
Using D6 with piwik 2.4
Comment #10
soulfroys@Hass, please, don't get me wrong, I'm just trying to help... It makes no sense to open another issue to discuss the same subject, I'm just telling to everyone: Hey! I'm investigating a bug in D6, because the problem occurs in both versions. By the way, I did not infringe any rule of Issue Queue Etiquette.
Anyway, I'm still your fan, I'm a fan of all the Drupal people that really contribute, as you do. I'm just trying to give my first steps...
Comment #11
soulfroysOops (Now I hijack!)
Comment #12
haggins CreditAttribution: haggins commentedAs Piwik overlay uses Drupals JQuery if present, I tested if JQuery 1.3.2 (latest D6 version) is the problem. But no. This can be excluded.
Comment #13
haggins CreditAttribution: haggins commentedAh, now I understand attiks point.
At D6 I just changed one line for testing:
to
And now it's working - thank you, attiks!
Comment #14
attiks CreditAttribution: attiks commentedYou're welcome :-)
Comment #15
hass CreditAttribution: hass commentedComment #16
haggins CreditAttribution: haggins commentedA piwik bug report has been opened: Ticket
So there are good chances, that this will be fixed in one of the next piwik releases.
Comment #17
attiks CreditAttribution: attiks commented#16 Any chance you can commit this in the mean time?
Comment #18
hass CreditAttribution: hass commentedWont't fix as piwik 1.11 has a fix. Leaving this case open just until piwik released 1.11.
Comment #19
kazudi CreditAttribution: kazudi commentedHey Guys,
i hope some one of you can help me, because the thread is a little bit confusing for me.
I installed the latest version of Drupal 6 and updated Piwik from 0.9 to 1.11.1. Now the tracking of my website works no longer. I understand integer-string-problem and in the bugtracker of piwik #3746 the problem is marked as closed.
Is the patch already part of the current piwik version (1.11.1) and when not, is there a solution to fix the problem.
Many thanks for your help
Comment #20
hass CreditAttribution: hass commentedLet's find out if the overlay works now with 1.11+
Comment #21
hass CreditAttribution: hass commentedIssue is fixed in Piwik 1.11.1, overlay work well.