Author Topic: Roundcube calendar plugin not working  (Read 42899 times)

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Roundcube calendar plugin not working
« on: April 20, 2010, 01:23:03 PM »
Hello Team,

I am new to linux and roundcube. I have implemented iRedMail with Roundcube as webmail solution.
Roundcube version is 0.3.1
I have installed Calendar plugin.
I am able to see calendar option. when I click on Calendar or try to post a new event, I get following error and no event is getting added.

Server Error! (OK)

Could someone please help me resolve this?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube calendar plugin not working
« Reply #1 on: April 21, 2010, 12:47:19 AM »
Looks like you did not not create 'events' database table correctly. What is in Roundcube's error log?
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Roundcube calendar plugin not working
« Reply #2 on: April 21, 2010, 04:33:06 AM »
I dont see any errors logged. I have enabled debug logging level to 8, I see only 3 files under /roundcubemail/logs folder. console, userlogin, and sendmail. These logs are not showing any errors related to the issue. Is there any other logging I need to increase ? (sorry this is very basic question)

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Roundcube calendar plugin not working
« Reply #3 on: April 21, 2010, 04:48:58 AM »
Also, I did create events table under roundcubemail database using mysql.sql script. I can see events table listed under roundcubemail database. Does it require any permission to be added to this database or table after this?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube calendar plugin not working
« Reply #4 on: April 22, 2010, 01:26:40 AM »
Are you able/willing to give me a test account, phpmyadmin access and read/write/delete FTP access to roundcube folder? PM'me! This problem was reported by another user as well, but has been never solved. I need to reproduce the issue to track it down.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Roundcube calendar plugin not working
« Reply #5 on: April 24, 2010, 07:27:48 AM »
Hello Rosali,

We were able to resolve the issue by adding following code to roundcybemail-0.3.1/program/include/rcube_shared.inc


if (!function_exists('json_encode'))
{
  function json_encode($a=false)
  {
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';
    if ($a === true) return 'true';
    if (is_scalar($a))
    {
      if (is_float($a))
      {
        // Always use "." for floats.
        return floatval(str_replace(",", ".", strval($a)));
      }

      if (is_string($a))
      {
        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
      }
      else
        return $a;
    }
    $isList = true;
    for ($i = 0, reset($a); $i < count($a); $i++, next($a))
    {
      if (key($a) !== $i)
      {
        $isList = false;
        break;
      }
    }
    $result = array();
    if ($isList)
    {
      foreach ($a as $v) $result[] = json_encode($v);
      return '[' . join(',', $result) . ']';
    }
    else
    {
      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
      return '{' . join(',', $result) . '}';
    }
  }
}

I am able to repro this issue and it resolves with this code change. Hope this will be helpful for someone :)

Offline cogancorp

  • Newbie
  • *
  • Posts: 4
RoundCube Calendar 0.2 BETA 2
« Reply #6 on: June 06, 2010, 11:43:41 PM »
Hi,

Just installed Roundcube and working fine.  Attempted to install the Roundcube Calendar plugin:

RoundCube Calendar

I imported the .sql file and see the "events" table but do not see any Calenaer Button under the menu nor can I pull up  
/plugins/calenadar/calendar.php.

Any help would be greatly appreciated.

Thanks,
-Todd

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,556
    • http://SKaero.com/
Roundcube calendar plugin not working
« Reply #7 on: June 07, 2010, 02:08:27 AM »
Did you add the calendar to the $rcmail_config['plugins'] in the /config/main.inc.php

Offline dziobak

  • Full Member
  • ***
  • Posts: 184
Roundcube calendar plugin not working
« Reply #8 on: June 07, 2010, 02:51:26 AM »
the calendar may not work with RC 0.2, because of jquery. Am I correct?

Offline suicidepills

  • Newbie
  • *
  • Posts: 1
Roundcube calendar plugin not working
« Reply #9 on: June 09, 2010, 08:21:41 PM »
Hey guys, I'm also getting the "server error (OK)" message when I try to add events.  It also displays when I browse to the calendar.

I've made sure that the 'events' table exists (I used PHPMyAdmin and copy-pasted the contents of the SQL file in there) and tried the mode that pinemail11 posted.  Still no dice :(

My log shows this at the bottom:

Code: [Select]
[09-Jun-2010 15:54:11 -0700]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_3055a37261af92c267005b94743a05546006f9f31 FROM 'DELETE FROM events\r\n         WHERE user_id=?\r\n         AND del=?']
[Native code: 1054]
[Native message: Unknown column 'del' in 'where clause']
 in /nfs/c06/h04/mnt/95491/domains/zandadev.com/html/roundcube/program/include/rcube_mdb2.php on line 272 (POST /roundcube/?_task=dummy&_action=plugin.calendar_purge?_task=&_action=)
[09-Jun-2010 15:54:12] MDB2 Error: no such field (-19): _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_38e7b9010444d91ca7db9000380ab8fa6b14c230b FROM 'SELECT * FROM events \r\n         WHERE user_id=? AND recurrence_id<>0']
[Native code: 1054]
[Native message: Unknown column 'recurrence_id' in 'where clause']

[09-Jun-2010 15:54:12 -0700]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_38e7b9010444d91ca7db9000380ab8fa6b14c230b FROM 'SELECT * FROM events \r\n         WHERE user_id=? AND recurrence_id<>0']
[Native code: 1054]
[Native message: Unknown column 'recurrence_id' in 'where clause']
 in /nfs/c06/h04/mnt/95491/domains/zandadev.com/html/roundcube/program/include/rcube_mdb2.php on line 272 (GET /roundcube/?_task=dummy&_action=plugin.getEvents&_=1276210340633&start=1275796800&end=1276401600)

Any ideas?  Please let me know what other information I should provide.

Thanks in advance!
« Last Edit: June 09, 2010, 08:34:57 PM by suicidepills »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Roundcube calendar plugin not working
« Reply #10 on: June 10, 2010, 12:27:17 AM »
Which calendar plugin do you use? It looks like you use mine (jquery fullcalendar forked by rosali) on the default database of the original plugin.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline LMSSML

  • Jr. Member
  • **
  • Posts: 49
Delete an event
« Reply #11 on: September 01, 2010, 12:14:11 PM »
Hi people ,

I'm trying to delete an event from calendar but it's not possible.

Error Service currently not available


Should I change something to this ?
« Last Edit: September 01, 2010, 12:26:30 PM by LMSSML »

Offline dziobak

  • Full Member
  • ***
  • Posts: 184
Roundcube calendar plugin not working
« Reply #12 on: September 01, 2010, 12:57:01 PM »
what version of calendar, RC??

look in /error and post here eventually errors

Offline toootooo

  • Jr. Member
  • **
  • Posts: 11
Roundcube calendar plugin not working
« Reply #13 on: September 09, 2010, 07:49:30 AM »
I've just installed Calendar plugin, installed postgresql DB 'events' and
'events_user_id' index. And while adding a new event the following error occur:

Quote

MDB2 Error: syntax error (-2): prepare: [Error message: Unable to create prepared statement handle]\n[Last executed query: DEALLOCATE PREPARE mdb2_statement_pgsql_26eaed0e7398ad4cf1b5555ad8dedce946448dd31]\n[Native message: ERROR:  syntax error at or near "end"\nLINE 2:          (user_id, start, end, summary, description, locatio...\n                                  ^]\n, referer: https://mailg.kipt.kharkov.ua/?_task=dummy&_action=plugin.calendar


From PGSQL:
Quote

STATEMENT:  INSERT INTO events
                 (user_id, start, end, summary, description, location, categories, all_day, recurring, rr, expires, occurrences, byday, bymonth, bymonthday, recurrence_id, uid, timestamp)
                 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)
WARNING:  nonstandard use of \\ in a string literal at character 30
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal at character 165
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.


What should i do?

Thanx in advance!

Offline alec

  • Hero Member
  • *****
  • Posts: 1,160
Roundcube calendar plugin not working
« Reply #14 on: September 09, 2010, 09:19:53 AM »
'end' column name must be quoted using rcube_mdb2::quote_identifier()