Befox / cdav

Dolibarr module to access calendars and address book from CalDAV/CardDAV tools
GNU General Public License v3.0
47 stars 28 forks source link

Error while activating module CDav #20

Closed matll42 closed 6 years ago

matll42 commented 6 years ago

Hi,

I'm actually having issue activating your module on my dolibarr installation. Each time I try to activate CDav, module stays Off. After some investigations, it appears that an insert in database is the cause.

Environment :

dolibarr.log :

2018-06-04 11:38:56 ERR     212.234.107.51->192.168.0.241  DoliDBMysqli::query SQL Error query: INSERT INTO llx_const (name,type,value,note,visible,entity) VALUES ('CDAV_URI_KEY','CDav uri key','751726bf','Change it to force client to resync','1',2)
2018-06-04 11:38:56 ERR     212.234.107.51->192.168.0.241  DoliDBMysqli::query SQL Error message: DB_ERROR_1406 Data too long for column 'type' at row 1

Table llx_const :

mysql> describe llx_const;
+---------+--------------+------+-----+-------------------+-----------------------------+
| Field   | Type         | Null | Key | Default           | Extra                       |
+---------+--------------+------+-----+-------------------+-----------------------------+
| rowid   | int(11)      | NO   | PRI | NULL              | auto_increment              |
| name    | varchar(255) | NO   | MUL | NULL              |                             |
| entity  | int(11)      | NO   |     | 1                 |                             |
| value   | text         | NO   |     | NULL              |                             |
| type    | varchar(6)   | YES  |     | NULL              |                             |
| visible | tinyint(4)   | NO   |     | 1                 |                             |
| note    | text         | YES  |     | NULL              |                             |
| tms     | timestamp    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+---------+--------------+------+-----+-------------------+-----------------------------+

As I'm on a testing instance, I handle it by changing my type on table llx_const : alter table llx_const MODIFY type varchar(12);

But It would by better if it is handled directly into source code (shorten string for type).

Mathieu

jpfox commented 6 years ago

Constant creation is now corrected since this commit : https://github.com/Befox/cdav/commit/43350da3394c65f3cf533d4f3ae4f6f32ceedd89 Download last version of cdav module

matll42 commented 6 years ago

Strange, I downloaded it from github this week and I must have been on a previous commit. I downloaded it again and now I'm on CalDav 1.10