• Resolved medrick37

    (@medrick37)


    Warning: max(): Array must contain at least one element in /home/wp_p5bhc3/rogersgardens.com/wp-content/plugins/the-events-calendar/src/Tribe/Cost_Utils.php on line 296

    Warning: array_merge(): Argument #1 is not an array in /home/wp_p5bhc3/rogersgardens.com/wp-content/plugins/the-events-calendar/src/Tribe/Cost_Utils.php on line 307

    Warning: Invalid argument supplied for foreach() in /home/wp_p5bhc3/rogersgardens.com/wp-content/plugins/the-events-calendar/src/Tribe/Cost_Utils.php on line 309

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Brook

    (@brook-tribe)

    Howdy Medrick,

    Thanks for reaching out so promptly after the update. We love to get early feedback on these things.

    There is probably only one of two things that could be causing this error:

    1) Do you have any The Events Calendar addons installed, like Community Events? If so they all need to be updated to 4.0. Any that are still on 3.x can generate errors.

    2) If the above does not apply, then it is probable your theme or a plugin is not yet compatible with version 4.x of the calendar. If I were you my first step would be figure out which one by doing a conflict test.?This guide?walks you through how to test for a conflict,?and then?identify what is conflicting. Once you know what’s not compatible, contact the author and see if they are aware of the issue and working on a fix. If a fix won’t be available for a while, then you might downgrade the plugin back to version 3.12 while you wait. We are still planning to support 3.12 for a while to give authors ample time to update everything, so no need to worry about 3.12 being insecure or anything.

    Does that all make sense?

    Cheers!
    – Brook

    Thread Starter medrick37

    (@medrick37)

    Hey Brook,

    Thanks for the quick response. We aren’t currently using any addons so there must be another conflict. I’ve reverted to 3.12 and I’m back up and running. If I discover the conflict with either my theme or another plug-in I’ll post here in case it helps any other users.

    Thanks again for the help Brook, much appreciated!

    Best,

    Medrick

    i have the same problem ??

    Thread Starter medrick37

    (@medrick37)

    Hey anice-girl,

    So far I haven’t been able to isolate the problem. To resolve I downloaded the 3.12 version (https://downloads.www.ads-software.com/plugin/the-events-calendar.3.12.6.zip) then disabled and deleted the 4.0 install. After that I just re-installed 3.12 and everything is looking good again. Hope that helps…

    Best,

    Medrick

    Thanks for the help medrick37! ?? i downgrade, but now, i have a new problem, i cant change de cost of old events, and new events are ”free” ??

    regards

    Thread Starter medrick37

    (@medrick37)

    Hmmmm… not sure about that one. I just added an event to test it on my end and I’m able to add cost info as well as edit the old ones. Sorry, I’m not sure what’s happening with the cost info on your end.

    Best of luck! If I think of anything else I’ll post it here…

    Best,

    Medrick

    i downgrade version by version to 3.10.1 and now works OK!
    thank you so much medrick for your quick responses! ??
    i hope author can help us to update to 4.0 without errors!

    best regards

    Anais

    Thread Starter medrick37

    (@medrick37)

    That’s great! Good thinking, glad it worked out for you!

    Yes, hopefully things will get resolved soon for us to update.

    Cheers!

    Medrick

    Brook

    (@brook-tribe)

    I am happy that worked for now Medrick. Thanks for getting back.

    Howdy Anais, at this point we can not help with that without knowing more. ?? Again, the probable cause is conflict between 4.0 and something designed for and older version. But that’s like searching for a needle in a haystack, and right now our haystack is every plugin and theme made for WordPress. if you do have an opportunity to do a conflict test we would love to dive in further.

    If you don’t have an opportunity to do that though, perhaps you could share a copy of your system info here? You can find the system info by going to WP Admin > Events > Settings, clicking on the “Help” tab, and scrolling down to the ‘System Information’ box. (Or by going to [yoursite]/wp-admin/edit.php?post_type=tribe_events&page=tribe-events-calendar&tab=help) Feel free to redact anything from that that you feel is private, but if you can at least share a complete list of your plugins and your theme then we can start rapidly narrowing the haystack.

    Cheers!
    – Brook

    I had the same errors as well. No add ons, no other plugins enabled on a clean testing site.

    I did a little digging, and it looks like if you put a non-numeric value in the Event Cost field, these errors crop up. (I manage a site where someone put ‘No Cost’ even though the reminder is there to use ‘0’ or leave blank.) You should be able to replicate the problem using something like ‘Free’ or ‘No Cost’.

    Thanks!

    Brook

    (@brook-tribe)

    Thanks for sharing Timothy. We have been investigating this further the past 24 hours and came to the same conclusion. It seems there are two possible causes for the issues in this thread.

    The warnings are indeed generated because text was input into the Event Cost field instead of a number. Up until a few versions back The Events Calendar allowed you to input text (like “No Cost”) into the cost field. But inputting text has always caused errors in various scenarios (and those errors have become more numerous in 4.0). So a few versions ago we made it so The Events Calendar would no longer allow text in the Event Cost field.

    However, events that were created in ancient versions of the calendar may still contain text, and will cause the PHP Warning seen in this thread. Further, importing an event via CSV will still allow text to be input, also causing error (this is a bug we are working on).

    To fix this you will need to find all events which have text in that field and change them to a number. To do this enmasse you can run some MySQL commands, perhaps from PHPMyAdmin. To get a list of all events which have this issue you could run the following SQL in your WordPress database:

    SELECT * FROM wp_postmeta
    WHERE
    meta_key=’_EventCost’ AND
    meta_value!=” AND
    concat(”, meta_value * 1) != meta_value

    You could then edit them on a case-by-case basis. If you wish to convert many of these at once you can run some SQL update commands. For instance the following will change everywhere that the word “No Cost” was typed in to the Event Cost field to the number 0, since 0 is treated as free in The Events Calendar.

    UPDATE wp_postmeta SET meta_value=’0′
    WHERE meta_key=”_EventCost” AND meta_value=”No Cost”

    If you wish to instead remove the cost value from all of the problem events, run this:

    UPDATE wp_postmeta SET meta_value=”
    WHERE
    meta_key=’_EventCost’ AND
    meta_value!=” AND
    concat(”, meta_value * 1) != meta_value

    Please note, there is always risk with running SQL commands on your database. It is a VERY good idea to make a database backup before dabbling with your data.

    I am very sorry for the inconvenience. At least now we have established what is causing it and have a fix though. Please let me know if you have any questions.

    Cheers!
    – Brook

    Brook

    (@brook-tribe)

    I should mention that doing this via SQL is the easy way to handle lots of events. The safest way to address this issue, and pretty simple for smaller amounts of events, is to edit the event which is generating an error, and change the Event Cost to a number.

    – Brook

    Hello,
    also a problem with the Event Cost – on the back-end the cost of an event is 0, but on the front-end “Free” is not showing in the header of the event (all events with 0 cost are affected):

    https://www.tupurdia.bg/sabitie/koledna-gratska-art-rabotilnitsa/

    Events Calendar V 4.0
    Theme: Sahifa

    Thanks for any help and suggestions on that,
    Rossy

    Plugin Author Brian

    (@brianjessee)

    Hi rjordanova2015,

    That is indeed a bug and we are working on a fix in either 4.0.1 or 4.0.2

    Thanks

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error in Cost_Utils.php after update to V-4.0’ is closed to new replies.