methnen / m-chart

Manage data sets and display them as charts in WordPress.
Other
43 stars 22 forks source link

Uninitialized string offset 0 #189

Open webconstructor opened 2 weeks ago

webconstructor commented 2 weeks ago

We get lots of warnings in our logs: Uninitialized string offset 0 in /srv/wordpress/wp-content/plugins/m-chart/components/class-m-chart-chartjs.php on line 169. about: https://github.com/methnen/m-chart/blob/master/components/class-m-chart-chartjs.php#L169

Could this be programmed a little more defensively?

methnen commented 2 weeks ago

Yeah, that's funny. So basically there's no chart data yet and it's throwing the warning. That's an easy enough fix.

I'll try to get that out quickly. That's an easy .x.x release.

I'm surprised that hasn't been called out by someone or noticed by myself before. I wonder if something else changed to make that occur more frequently.

webconstructor commented 2 weeks ago

Nice, thx

Op 16 sep 2024, om 19:23 heeft Jamie Poitra @.***> het volgende geschreven:

Yeah, that's funny. So basically there's no chart data yet and it's throwing the warning. That's an easy enough fix.

I'll try to get that out quickly. That's an easy .x.x release.

— Reply to this email directly, view it on GitHub https://github.com/methnen/m-chart/issues/189#issuecomment-2353496319, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVVMVC6RA2F77426UB57WLZW4H25AVCNFSM6AAAAABOIZOXR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJTGQ4TMMZRHE. You are receiving this because you authored the thread.

methnen commented 2 days ago

Spent a little time on this and I oddly can't duplicate it at all. That said, I've added an additional check to make sure there's something there before passing it to the parse function.

I also fixed another warning I found along the way.

https://github.com/methnen/m-chart/pull/193

I you could try this one out and see if it works that would be awesome and I'll then push it live to everyone. It's a small change.

webconstructor commented 1 day ago

Hi Jamie

We only have this on our production servers. So if you have programmed this a bit more defensively and it doesn’t break anything we can test it with a new release.

greetings Inigo

Op 30 sep 2024, om 00:55 heeft Jamie Poitra @.***> het volgende geschreven:

Spent a little time on this and I oddly can't duplicate it at all. That said, I've added an additional check to make sure there's something there before passing it to the parse function.

I also fixed another warning I found along the way.

I you could try this one out and see if it works that would be awesome and I'll then push it live to everyone. It's a small change.

— Reply to this email directly, view it on GitHub https://github.com/methnen/m-chart/issues/189#issuecomment-2381641573, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVVMVD3HZ4YHCLPPVWJJF3ZZCAPRAVCNFSM6AAAAABOIZOXR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBRGY2DCNJXGM. You are receiving this because you authored the thread.

methnen commented 1 day ago

Ah, so the warning is only happening on production. That's interesting.

It's a small change and it should not break anything.