Skip to content

Prevent warning array to string conversion in console renderer #15037

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

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 22, 2019

See https://forum.matomo.org/t/notice-array-to-string-conversion-matomo-3-11-0/34644

As we don't have more information yet I couldn't reproduce it. Looking at the code it seems though like some metadata has an array in there. I didn't even quite know we had this renderer and from what I can see we're using it to convert a dataTableMap to a string. Not sure when and why. It should fix the warning though.

See https://forum.matomo.org/t/notice-array-to-string-conversion-matomo-3-11-0/34644

As we don't have more information yet I couldn't reproduce it. Looking at the code it seems though like some metadata has an array in there. I didn't even quite know we had this renderer and from what I can see we're using it to convert a dataTableMap to a string. Not sure when and why. It should fix the warning though.
@tsteur tsteur added the Needs Review PRs that need a code review label Oct 22, 2019
@tsteur tsteur added this to the 3.13.0 milestone Oct 22, 2019
@tsteur
Copy link
Member Author

tsteur commented Oct 23, 2019

BTW I was seeing this error heaps of times in the logs.

Noticed it comes from twig when checking if an object is empty

image

in the dataTable twig

image
(could be a performance tweak to adjust this as the dataTable would maybe always return a string anyway)

@diosmosis diosmosis merged commit 47dfbef into 3.x-dev Nov 4, 2019
@diosmosis diosmosis deleted the arraystringmapconsole branch November 4, 2019 00:24
diosmosis pushed a commit that referenced this pull request Nov 4, 2019
…ns (#15044)

* Slight performance improvement when rendering data table visualisations

refs #15037

* apply review feedback
diosmosis pushed a commit that referenced this pull request Nov 6, 2019
See https://forum.matomo.org/t/notice-array-to-string-conversion-matomo-3-11-0/34644

As we don't have more information yet I couldn't reproduce it. Looking at the code it seems though like some metadata has an array in there. I didn't even quite know we had this renderer and from what I can see we're using it to convert a dataTableMap to a string. Not sure when and why. It should fix the warning though.
diosmosis pushed a commit that referenced this pull request Nov 6, 2019
…ns (#15044)

* Slight performance improvement when rendering data table visualisations

refs #15037

* apply review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Development

Successfully merging this pull request may close these issues.

2 participants