Localized and stripped return value of FetchrowArray?

Hi, the following SQL query returns (ceate_time) e.g. "2012-05-22 11:26:39" - in the SQL query box for instance. [Kernel/System/Ticket.pm in OTRS 3.1.5] 2535 return if !$Self->{DBObject}->Prepare( 2536 SQL => 'SELECT article_sender_type_id, article_type_id, create_time FROM ' 2537 . 'article WHERE ticket_id = ? ORDER BY create_time ASC', 2538 Bind => [ \$Param{TicketID} ], 2539 ); BUT in the RowArray $Row[2] is "22.05.2012" - it's lacking the time and has german time format. 2433 while ( my @Row = $Self->{DBObject}->FetchrowArray() ) { push @SenderHistory, { SenderTypeID => $Row[0], ArticleTypeID => $Row[1], Created => $Row[2], Result is, other internal time functions get an invalid format as an input and return zero. Therefore, in case of tickets, which haven't been manually touched by agents (tickets via mailin) escalation time is wrongly calculated. This applies for OTRS 3.1.5 still. I wanted to fix it, but could do this only with a rather dirty hack because of my FetchRowarray() problems. TIA Michael

Hi Michael, Michael Scheer schreef op 2012-05-25 08:52:
the following SQL query returns (ceate_time) e.g. "2012-05-22 11:26:39" - in the SQL query box for instance.
...
BUT in the RowArray $Row[2] is "22.05.2012" - it's lacking the time and has german time format.
Could it be that you use a database such as Oracle where you can influence the time stamp format based on user locale? I think that the format for Apache (which you'll see via the web front end) and the otrs user (which your emails will use) will return a different time stamp format. In case you're using Oracle, you might want to stick this line into your Config.pm : $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS'; -- Mike

Hi Guys, Can anyone help me convert the following code for MSSQL? ALTER IGNORE TABLE ticket_flag ADD CONSTRAINT ticket_flag_per_user UNIQUE INDEX (ticket_id, ticket_key, create_by); Thanks in advance! Aaron

Aaron G. Angeles schreef op 2012-05-25 16:19:
Can anyone help me convert the following code for MSSQL?
ALTER IGNORE TABLE ticket_flag ADD CONSTRAINT ticket_flag_per_user UNIQUE INDEX (ticket_id, ticket_key, create_by);
Hi Aaron; you should not have to! Check http://bugs.otrs.org/show_bug.cgi?id=8237#c9 "Error while applying ticket_flags constraint when running upgrade from 3.0 to 3.1" -- Mike
participants (3)
-
Aaron G. Angeles
-
Michael Scheer
-
Michiel Beijen