texxasrulez / calendar

GNU Affero General Public License v3.0
15 stars 14 forks source link

PHP Errors - feof/fgets/array_merge #18

Open ner00 opened 3 years ago

ner00 commented 3 years ago

Hi.

I'm having a bit of trouble getting the plugin to work correctly. It does work correctly, apparently, but seems to clash with cardDAV plugin. I'm not 100% sure where the issue comes from. In an attempt to figure out what may be my issue, I have tested disabling all other plugins except calendar, and when signing into the account it fetches the calDAV events perfectly but logs the erros below:

[27-Apr-2021 17:10:24 UTC] PHP Warning:  feof() expects parameter 1 to be resource, null given in /home/public_html/roundcube/vendor/sabre/vobject/lib/Parser/MimeDir.php on line 279
[27-Apr-2021 17:10:24 UTC] PHP Warning:  fgets() expects parameter 1 to be resource, null given in /home/public_html/roundcube/vendor/sabre/vobject/lib/Parser/MimeDir.php on line 281
[27-Apr-2021 17:10:24 UTC] PHP Warning:  feof() expects parameter 1 to be resource, null given in /home/public_html/roundcube/vendor/sabre/vobject/lib/Parser/MimeDir.php on line 283
[27-Apr-2021 17:10:24 +0000]: <b31d3c96> PHP Error: iCal data parse error: Error reading from input stream in /home/public_html/roundcube/plugins/libcalendaring on line 163 (GET /?_task=calendar)
[27-Apr-2021 17:10:24 UTC] PHP Warning:  array_merge(): Argument #1 is not an array in /home/public_html/roundcube/plugins/calendar/drivers/caldav/caldav_driver.php on line 1947

I'm using Roundcube 1.4.11, PHP 7.1, and the current release of calendar plugin v0.0.7, sabre v4.1.1 And if it matters, the calDAV is in a cPanel shared hosting environment.

ner00 commented 3 years ago

I've added some checks to avoid the errors, like elseif(is_resource($this->input)) {, and although the calendar is fetched properly regardless, something about using cardDAV plugin simultaneously breaks calDAV. Whatever it is doesn't seem to get logged since I only get the one now: [27-Apr-2021 18:08:04 +0000]: <ff9a9e09> PHP Error: iCal data parse error: This parser only supports VCARD and VCALENDAR files in /home/public_html/roundcube/plugins/libcalendaring on line 163 (GET /?_task=calendar)

ner00 commented 3 years ago

I seem to have found the problem, cardDAV plugin is bundled with sabre, particularly vobject, and that one seems to be clashing with the one installed in the root vendor folder, so I just removed the one in cardDAV and it seems to be working now. Not sure about the other error mentioned before, why or what is that the parser attempts to parse which is not a valid calendar resource.

hpkunz commented 3 years ago

so did you get it running with SOGo? could you send me the changes to you did to get rid of the "expects parameter 1 to be resource" errors?

ner00 commented 3 years ago

SOGo

I don't remember mentioning that, so the answer is probably no.

This was native RoundCube I was talking about. As I mentioned in my previous reply, I removed the vobject folder, inside the sabre library that comes with the cardDAV plugin. RoundCube is already bundled with a different version of sabre library and there was a clash in the resources, namely vobject. At least that was the fix for me, didn't change a single line of code. AS for SOGo, I have no clue.