sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Error modifying occurrence #54

Closed coopuk closed 11 years ago

coopuk commented 11 years ago

Hi, great product, very useful! Spotted a fairly obvious bug tho -

  1. Add an Event
  2. Click on the Event, click on Modify Occurence
  3. Change the To Date, click on Submit Occurence - and you get:

Error Malformed time in "end" date.

Backtrace
#0 D:\uniformserver\UniServer\www\calendar\includes\occur_form.php(196): soft_error('Malformed time ...')
#1 D:\uniformserver\UniServer\www\calendar\includes\occur_form.php(115): get_timestamp('end')
#2 D:\uniformserver\UniServer\www\calendar\includes\occur_form.php(31): process_form()
#3 D:\uniformserver\UniServer\www\calendar\includes\calendar.php(679) : eval()'d code(1): occur_form()
#4 D:\uniformserver\UniServer\www\calendar\includes\calendar.php(679): eval()
#5 D:\uniformserver\UniServer\www\calendar\includes\calendar.php(625): do_action()
#6 D:\uniformserver\UniServer\www\calendar\index.php(77): display_phpc()
#7 {main}
sproctor commented 11 years ago

Our error message is probably a little overzealous. It's easy to get there if you edit the time by hand and don't put it in the proper format. What did you put for the time in the To Date?

coopuk commented 11 years ago

Hi Sean

I still think it’s a bug – here are some screen prints.

This is the existing event: [cid:image009.jpg@01CE45A8.574CB430]

So I click on the To Date and modify it using the Calendar:

[cid:image010.jpg@01CE45A8.574CB430]

That gives me this screen: [cid:image011.jpg@01CE45A8.574CB430]

Notice the interesting difference in date formats! Now I click Submit Occurrence: [cid:image012.jpg@01CE45A8.574CB430]

Tilt! Any thoughts?

sproctor commented 11 years ago

Github doesn't handle images very well. Can you send that to sproctor@gmail.com? I can't see the images and they messed up the formatting pretty well.

sabas commented 11 years ago

@sproctor I can recreate the same error having an event (single occurrence) and modifying it via 'Modify occurrence' instead of 'Modify'. If single occurrence phpcalendar shouldn't allow to edit occurrence perhaps (only add another occurence?)

sproctor commented 11 years ago

The get_timestamp() from occur_form.php wasn't updated to handle the addition of the date format. I didn't notice this because I left the date format as the default, which works fine. I have a fix for this ready, but I was running across some weird bug in my dev environment.

sproctor commented 11 years ago

This is fixed by commit 30b0162 and will be in the next release.

coopuk commented 11 years ago

That’s fine – thanks for the update. It is fairly obvious that you should use Modify rather than Modify Occurrence on a single event, but the fact that my fairly educated testers spotted it is telling ;)

Thanks for taking the time to look at this!

sabas commented 11 years ago

@coopuk :-)

Could you please reply from main github issue page? Otherwise appears all yr email signature.. Thank you for testing !

coopuk commented 11 years ago

Ahhh lovely GitHub :) Yes - thanks for all the work on this.

sproctor commented 11 years ago

It might be a while before there's a version out that fixes this. If you want to get the current development version without using git, you can download it at https://github.com/sproctor/php-calendar/archive/master.zip

coopuk commented 11 years ago

That's fine, I can warn my guys about the function and the date/time format "blip" for the moment. I'll probably take a look at the latest dev version in the next couple days. Thanks for all your help!

sproctor commented 11 years ago

You could also set the date format back to the initial "month day year". The problem only manifests when it's changed from that, which is why I missed it.