Roundcube Community Forum

 

Roundcube calendar plugin not working

Started by pinemail11, April 20, 2010, 01:23:03 PM

Previous topic - Next topic

pinemail11

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?

rosali

Looks like you did not not create 'events' database table correctly. What is in Roundcube's error log?
Regards,
Rosali

pinemail11

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)

pinemail11

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?

rosali

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

pinemail11

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 :)

cogancorp

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

SKaero

Did you add the calendar to the $rcmail_config['plugins'] in the /config/main.inc.php

dziobak

the calendar may not work with RC 0.2, because of jquery. Am I correct?

suicidepills

#9
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:

[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!

rosali

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

LMSSML

#11
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 ?

dziobak

what version of calendar, RC??

look in /error and post here eventually errors

toootooo

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:

QuoteMDB2 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:
QuoteSTATEMENT:  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!

alec

'end' column name must be quoted using rcube_mdb2::quote_identifier()