Skip to content

Issue in piwik.js function logEvent #13165

@hamburger123456

Description

@hamburger123456

If you call the function

logEvent(category, action, name, value, customData, callback)

without parameter it shout gives an error.

(logConsoleError(‘Error while logging event: Parameters category and action must not be empty or filled with whitespaces’);

But it doesn’t. Because the line

 if (trim(String(category)).length === 0 || trim(String(action)).length === 0) { ...

will not work. String(category) returns always 9 (the length of the word undefined) when categorie is empty
So the error will never been showed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor errors / faults / flaws / inconsistencies etc.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions