–Version of event manager : Events Manager (6.4.6.4)
My problem :
In the file errorlog-php, I’ve got some recursive errors (one every about 5 minutes) :
[27-Feb-2024 07:23:24 UTC] PHP Warning: Array to string conversion in /srv/data/web/vhosts/…/htdocs/wp-content/plugins/events-manager/classes/em-calendar.php on line 494
I’ve seen in this support forum, some people have the same error.
[02-Mar-2024 16:12:08 UTC] PHP Warning: Array to string conversion in /srv/data/……../wp-content/plugins/events-manager/classes/em-calendar.php on line 501
The function EM_Calendar::output is getting called with a $args array and it has an entry $args[‘style’] which is equal to array([background_image_attachment => “”, background_display=> “tile”)
This doesn’t seem to be coming from the Events Manager plugin. Are you using Events Manager Pro? Looks like this error comes when displaying the Events Calendar Widget. Are then any url parameters when dispaying the page? Is there some way to specify the background style when adding widgets in your theme?
You could try the following code snippet to fix this problem:
You must have made a mistake when copying and pasting the code snippet. Make sure you copy the code snippet from the code block in this thread (not from the email).
Otherwise, I assure you that I copied your code correctly without any errors. The widget does show a syntax error, which I fixed by adding a parenthesis at the end of the ‘if’ condition line.
You’re correct, there was a missing paren in my code snippet. Hopefully, the plugin author will add a check to prevent the PHP Warning that you are reporting in a future release.
This reply was modified 1 year, 10 months ago by joneiseman.