sproctor / php-calendar

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

Adding user to group #91

Closed hayyagahoy closed 10 years ago

hayyagahoy commented 10 years ago

Hello,

I am having a problem adding a user to a group. If I make the group ahead of time and add them into it while creating the user all goes fine. If I make the user, and then later try to add them in to a group it gives me this error:

Error

Invalid gid Backtrace

#0 /var/www/phpcalendar/phpcal/includes/user_groups.php(92): soft_error('Invalid gid')
#1 /var/www/phpcalendar/phpcal/includes/user_groups.php(30): process_form()
#2 /var/www/phpcalendar/phpcal/includes/calendar.php(680) : eval()'d code(1): user_groups()
#3 /var/www/phpcalendar/phpcal/includes/calendar.php(680): eval()
#4 /var/www/phpcalendar/phpcal/includes/calendar.php(626): do_action()
#5 /var/www/phpcalendar/phpcal/index.php(76): display_phpc()
#6 {main}

It may be me doing something wrong, I'm not sure. I am using your latest release: php-calendar-2.0

hayyagahoy commented 10 years ago

Something I should add is if I create a new group and assign a user to it under the main calendar then it works fine.

sproctor commented 10 years ago

I reproduced this. It's only a problem if you have multiple calendars, I believe. It acts on the default calendar when you submit the form instead of the current calendar.

sproctor commented 10 years ago

This is fixed in git. Please see 1be05fc3608fe8d92c0d4c154a09ab4ac7bad4ee You can apply those changes to your version to fix the issue or wait until the next version comes out. I have quite a large number of things on my plate right now. It may be a while until the next version is out.

hayyagahoy commented 10 years ago

Thankyou very much for taking the time to look at it. I can apply the change no problem. I understand being busy. Thanks for your awesome work!

sproctor commented 10 years ago

I changed my mind. I've fixed a few bug and I'm going to release a new version based on 2.0 soon. In the meantime you can download it here https://github.com/sproctor/php-calendar/tree/v2.0.x at the download zip link on the right.