craigk5n / webcalendar

WebCalendar is a PHP application used to maintain a calendar for a single user or an intranet group of users. It can also be configured as an event calendar.
http://www.k5n.us/webcalendar.php
GNU General Public License v2.0
153 stars 75 forks source link

Multiple issues with repeating events #73

Open Siderealist opened 6 years ago

Siderealist commented 6 years ago

Current build out of github, Apache 2.4.27, PHP 7.1.9.

1) After creating a repeating event, attempts to edit it will return an error and a skewed Type field. The error returned is:

Warning: A non-numeric value encountered in /usr/local/apache2/htdocs/.../calendar/edit_entry.php on line 765

2) In the Repeat tab for a repeating event, Exclusions and Inclusions do not work. Clicking on the "Add Exception" or "Add Inclusion" buttons does nothing.

3) In the Repeat tab for a repeating event, selecting a Weekly repeat type and then choosing individual days for the event seems to have random results as to which days the event will actually repeat and which won't. I can find no rhyme or reason for how it decides.

Siderealist commented 6 years ago

With current (2/7) version out of github, issues 1 and 3 seem to be fixed. 2 is still broken.

FranzGotsis commented 6 years ago

As I had the same problem: I experimented a bit and I came up with a simple solution to problem 2:

Simply modify the file js_cacher.php in the installation root directory: old lines at the end of the file: // We only allow includes if they exist in our includes/js directory, or HTMLarea $newinc = 'includes/' . $arinc[0] . '/' . $arinc[1]; if ( is_file ( $newinc ) && in_array ( $arinc[1], $fileList ) ) include_once ( $newinc );

new lines at the end of the file: $newinc = 'includes/' . $arinc[0] . '/' . $arinc[1]; if ( is_file ( $newinc ) && in_array ( $arinc[1], $fileList ) ) { include_once ( $newinc ); }

Just add braces to the if-Statement. It seems that PHP 7.1.x requires them. I have no idea why this is the case, but it definitely works.

The reason I came to change js_cacher.php is, that if you let your browser show the code of the page you will see add_exception is missing, which can be verified simply by adding an alert statement as a debugging aid into the function in /includes/js/edit_entry.php in the function "add_exception".

kind regards Franz

Siderealist commented 6 years ago

I just tried your redone js_cacher.php with the new commit, and still could not get the buttons to work.

FranzGotsis commented 6 years ago

It did do it for me (2 installations PHP 7.1.x, MySQL and WebCalendar 1.29), so I guess it requires to figure out the differences in our installation. Maybe you send me an E-Mail at development@diargo.de. One thought: The button reaction is implemented in Javascript. If you add an echo command in the if-branch to see whether you get there - the relevant javascript is added with the include_once code above.