I have some views pages that have no menu item. Therefore the title in the menu router item is empty. As a consequence piwik tracks all of the pages without setting the title respectively sets it an empty string.

Sending patch after I got an issue number.

Comments

marcusx’s picture

Status: Active » Needs review
StatusFileSize
new721 bytes

Patch...

Remove empty item from menu system before using drupal_json_encode, also set title using drupal_set_title if there is no title in menu_router table.

hass’s picture

Thanks for report. Why are we not changing function _piwik_get_hierarchy_titles() ? We should write tests.

hass’s picture

Issue summary: View changes
Status: Needs review » Fixed
+++ b/piwik.module
@@ -113,7 +113,11 @@ function piwik_page_alter(&$page) {
+      if ((count($titles) < 2) && !drupal_is_front_page()) {
+        $titles[] = drupal_get_title();
+      }

I do not understand the reason for this, but added the array_filter() as I was able to reproduce the bug with a view. The filtering of empty titles has fixed all issues for me.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.