Creating new absence type fails.

If you need support with TeamCal Pro (installation, configuration, usage) post your request here.
Post Reply
indyfaorg
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 2015-04-13, 20:28
Are you a spam bot?: No

Creating new absence type fails.

Post by indyfaorg » 2015-04-14, 16:30

Using TeamCal Pro Version: 3.6.018

1) I go to Administration-> Absence Type Edit

2) I put a name in the "create absence" box, fill out the rest of the desired fields; "Name", "Symbol", etc.

3) Click "Create"

And here is the result:

TeamCal Pro Database Error
Module: db_model.php
Class: Db_model
Function: db_query(), Line 125
Error:
Error: A problem was encountered while executing this query:
INSERT INTO `my_tc_absences` (
`name`,
`symbol`,
`icon`,
`color`,
`bgcolor`,
`bgcolor`,

`bgtransparent`,
`allowance`,
`counts_as`,
`show_in_remainder`,
`show_totals`,
`approval_required`,
`counts_as_present`,
`manager_only`,
`hide_in_profile`,
`confidential`,
`admin_allowance`
) VALUES (
'test_absence',
'A',
'No',
'000000',
'FFFFFF',
'0',
'1',
'0',
'0',
'1',
'1',
'0',
'0',
'0',
'0',
'0',
'0'
)
SQL Error:
Column 'bgcolor' specified twice
Execution halted

It appears that "models/absence_model.php" has the wrong fields in it, there are two 'bgcolor' fields and no "factor" fields.
I think that if I replace the second "bgcolor" field with "bgtransparent" and add a "factor" field it will work.

Is there anything else this change might affect?

Code: Select all

[code][code][code]mysql> desc my_tc_absences
    -> ;
+-------------------+-------------+------+-----+---------+----------------+
| Field             | Type        | Null | Key | Default | Extra          |
+-------------------+-------------+------+-----+---------+----------------+
| id                | int(11)     | NO   | PRI | NULL    | auto_increment |
| name              | varchar(80) | NO   |     | NULL    |                |
| symbol            | char(1)     | NO   |     | A       |                |
| icon              | varchar(80) | NO   |     | NULL    |                |
| color             | varchar(6)  | NO   |     | NULL    |                |
| bgcolor           | varchar(6)  | NO   |     | NULL    |                |
| bgtransparent     | tinyint(1)  | NO   |     | 0       |                |
| factor            | float       | NO   |     | NULL    |                |
| allowance         | float       | NO   |     | NULL    |                |
| counts_as         | int(11)     | NO   |     | NULL    |                |
| show_in_remainder | tinyint(1)  | NO   |     | NULL    |                |
| show_totals       | tinyint(1)  | NO   |     | NULL    |                |
| approval_required | tinyint(1)  | NO   |     | NULL    |                |
| counts_as_present | tinyint(1)  | NO   |     | NULL    |                |
| manager_only      | tinyint(1)  | NO   |     | NULL    |                |
| hide_in_profile   | tinyint(1)  | NO   |     | NULL    |                |
| confidential      | tinyint(1)  | NO   |     | NULL    |                |
| admin_allowance   | tinyint(4)  | NO   |     | NULL    |                |
+-------------------+-------------+------+-----+---------+----------------+
18 rows in set (0.00 sec)
[/code][/code][/code]
DBa
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 2015-05-17, 22:03
Are you a spam bot?: No

Re: Creating new absence type fails.

Post by DBa » 2015-05-18, 05:54

I have the same problem, is there any solution?
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 382
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re: Creating new absence type fails.

Post by George » 2015-05-29, 20:20

Hi guys
sorry for the delay in my reply.
Indeed a serious bug. Sorry for that.
Further tracked here:
https://georgelewe.atlassian.net/browse/TCP-137
Post Reply