Skip to content
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

Prevent possible error when goal deleted. #12395

Closed
wants to merge 1 commit into from
Closed

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jan 2, 2018

Should prevent an error like this:

Error: {"message":"Key \"\" for array with keys \"4\" does not exist.","file":"plugins\/Live\/templates\/_profileSummary.twig","line":24}

The visitor log / profile fetches currently all goal conversions and does check whether a goal still exists so not sure why it is needed (in https://github.com/piwik/piwik/blob/3.3.0-b1/plugins/Goals/VisitorDetails.php#L67 ). Where this happened the goal actually exists but the other first 3 goals are deleted.

Here is some output from visitor data and idGoal 4 is definitely set in goals


["totalConversionsByGoal"]=>
  array(2) {
    [1]=>
    int(0)
    ["idgoal=4"]=>
    int(1)
  }

It seems to cause an error when there is also an ecommerce action like here where I printed also {{ goals|json_encode }}{{ visitorData.totalConversionsByGoal|json_encode }}:

image

Actually: This does not fix the problem because it would never show any entry as idgoal=4 cannot be set in Goals so there must be a different fix.

Should prevent an error like this:

```
Error: {"message":"Key \"\" for array with keys \"4\" does not exist.","file":"plugins\/Live\/templates\/_profileSummary.twig","line":24}
```

The visitor log / profile fetches currently all goal conversions and does check whether a goal still exists so not sure why it is needed  (in https://github.com/piwik/piwik/blob/3.3.0-b1/plugins/Goals/VisitorDetails.php#L67 ). Where this happened the goal actually exists but the other first 3 goals are deleted.

Here is some output from visitor data and idGoal 4 is definitely set in `goals`
```

["totalConversionsByGoal"]=>
  array(2) {
    [1]=>
    int(0)
    ["idgoal=4"]=>
    int(1)
  }
```
@tsteur
Copy link
Member Author

tsteur commented Jan 3, 2018

Actually, the bug was caused by another plugin.

@tsteur tsteur closed this Jan 3, 2018
@sgiehl sgiehl deleted the goaldeletedprofile branch April 28, 2020 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant