Bug in Calendar categories

penguin8r wrote on Friday, February 19, 2016:

Have now seen this on 2 running systems, I dismissed the first occurrence as a one off glitch, but now after looking at the 2nd one in detail I’m inclined to suspect a latent bug. Not an OpenEMR bug so much as a problem with the embedded Smarty/PostNuke code.

When you attempt to add a new Event Category to the Calendar, a pink error bar appears at the top of the screen with this message:

Hours, Minutes and recurrence values must be numeric!

and your new event type is not saved. Same error message is displayed if you try to edit existing Categories (change times, color codes, descriptions, etc).

I have verified that all the Hour, Minute, and recurrence data values in the ‘openemr_postcalendar_categories’ are indeed numeric. Tried swapping in fresh copy of the pnadmin.php in case of corruption, etc, that didn’t help, then I got curious, so I backed up the existing categories table, re-initialized the table with default settings from the sql install script, same problem. This makes me think the error message that’s displayed, isn’t actually what’s wrong.

Anyone seen this before? Any resolution?

fsgl wrote on Saturday, February 20, 2016:

Just added 2 new Calendar Categories under Type, Patient, edited 2nd Category & used both to add New Event in Weekly Demo without difficulty.

Have you tried to backup & restore with script to a brand new copy of OE?

Sounds like corruption.

If it works, easier to backup/restore than to troubleshoot.

penguin8r wrote on Thursday, February 25, 2016:

I’m starting to think it’s actually something in the event table, rather than the categories table.
I haven’t tried messing with that table, and I don’t want to just yet since this is a production system, but there is a test site on the server with a copy of their production database, so I’m going to do some experimenation there and see if I can narrow down where the problem is actually coming from.
I did run a mysqlcheck just in case, and it came through clean, so it could be that there’s a field in one of the records somewhere that’s got bad data stored in it.

penguin8r wrote on Friday, February 26, 2016:

OK, finally figured it out. This is what happens when somebody decides to play with the calendar who shouldn’t be. Somebody managed to save an empty value in the “Months” field, for a recurring event.
Note to anybody who runs into this issue, check all the calendar categories very carefully for an empty field or null values.
Only thing I can’t figure out is how this empty field didn’t get re-populated when I re-loaded the default table values.
Problem solved.