ProjeQtOr free project management software - [SOLVED] After dulpicating a ticket from another Ticket last update seem to be wrong. - ProjeQtOr
 

[SOLVED] After dulpicating a ticket from another Ticket last update seem to be wrong.

More
11 Jan 2020 16:57 #1 by ozed
Thanks for this wonderful tool

After dulicating a ticket last uodate seem to be wrong.

Data on mysql
> select id,name,lastUpdateDateTime, ts,tsd from Ticket order by id desc limit 1;
+----+
+
+
+
+
| id | name | lastUpdateDateTime | ts | tsd |
+----+
+
+
+
+
| 20 | t1 copie | NULL | 0000-00-00 00:00:00 | 2020-01-11 16:41:16 |
+----+
+
+
+
+
1 row in set (0.00 sec)
tsd is the real date


select distinct t.id, t.name, lastUpdateDateTime,h.operationDate , t.ts,t.tsd
-> from Ticket t, history h
-> where h.refId=t.id and ( h.operationDate >T.lastUpdateDateTime OR T.lastUpdateDateTime is NULL) order by h.operationDate desc limit 5;
+----+
+
+
+
+
+
| id | name | lastUpdateDateTime | operationDate | ts | tsd |
+----+
+
+
+
+
+
| 20 | t1 copie | NULL | 2020-01-11 16:41:16 | 0000-00-00 00:00:00 | 2020-01-11 16:41:16 |
| 18 | bugProjektor 4 | NULL | 2020-01-11 16:28:35 | 0000-00-00 00:00:00 | 2020-01-11 16:28:08 |
| 18 | bugProjektor 4 | NULL | 2020-01-11 16:28:08 | 0000-00-00 00:00:00 | 2020-01-11 16:28:08 |
| 17 | bugProjektor 3 | NULL | 2020-01-11 16:07:10 | 0000-00-00 00:00:00 | 2020-01-11 16:02:08 |
| 17 | bugProjektor 3 | NULL | 2020-01-11 16:03:44 | 0000-00-00 00:00:00 | 2020-01-11 16:02:08 |
+----+
+
+
+
+
+
5 rows in set (0.01 sec)

select distinct t.refId,t.refType,t.refname, h.refId,h.refType,colname,h.operationDate , t.ts,t.tsd
-> from workelement t, history h
-> where h.refId=t.id order by h.operationDate desc limit 5;
+
+
+
+
+
+
+
+
+
+
| refId | refType | refname | refId | refType | colname | operationDate | ts | tsd |
+
+
+
+
+
+
+
+
+
+
| 20 | Ticket | t1 copie | 20 | Ticket | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 20 | Ticket | t1 copie | 20 | WorkElement | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 19 | Ticket | t1 | 19 | Ticket | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 19 | Ticket | t1 | 19 | WorkElement | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
|
+
+
+
+
+
+
+
+
+
+

select distinct t.refId,t.refType,t.refname, h.refId,h.refType,colname,h.operationDate , t.ts,t.tsd from workelement t, history h where h.refId=t.id order by h.operationDate desc limit 5;
+
+
+
+
+
+
+
+
+
+
| refId | refType | refname | refId | refType | colname | operationDate | ts | tsd |
+
+
+
+
+
+
+
+
+
+
| 20 | Ticket | t1 copie | 20 | Ticket | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 20 | Ticket | t1 copie | 20 | WorkElement | NULL | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 | 2020-01-11 16:41:16 |
| 19 | Ticket | t1 | 19 | Ticket | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 19 | Ticket | t1 | 19 | WorkElement | NULL | 2020-01-11 16:38:20 | 0000-00-00 00:00:00 | 2020-01-11 16:38:20 |
| 18 | Ticket | bugProjektor 4 | 18 | WorkElement | plannedWork | 2020-01-11 16:28:35 | 2020-01-11 16:28:35 | 2020-01-11 16:28:09 |
+
+
+
+
+
+
+
+
+
+

Sincerly

Please Connexion or Create an account to join the conversation.

More
11 Jan 2020 17:40 #2 by babynus
Sorry, but I don't understand what issue you try and point out with your select.
Please explain.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
11 Jan 2020 20:10 - 11 Jan 2020 20:19 #3 by ozed
Sorry ! I was not clear :

How to reproduice the bug on :
ProjeQtOr V8.3.1 (249) 5.6.35-log MySQL Community Server
1) Use an existing Ticket and clique on : Copy the current ticket
2° go to the > wotk > Tickets list
last update is NULL

I think that you can find the wrong lastUpdateDateTime date in table Ticket by this query :
( if you have done before action of Copy the current ticket )
SELECT distinct t.id, t.name, lastUpdateDateTime,h.operationDate
FROM Ticket t, history h
WHERE h.refId=t.id and ( h.operationDate >T.lastUpdateDateTime OR T.lastUpdateDateTime is NULL)

In order to check the updates, I added 2 colmuns to the table tickets.

`ts` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`tsd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

TIMESTAMP columns are automatically initializated and updated to the current date and time by the server.
It helped me to see what's going on.

find some attached files


Thanks
Attachments:
Last edit: 11 Jan 2020 20:19 by ozed.

Please Connexion or Create an account to join the conversation.

More
11 Jan 2020 23:00 #4 by babynus
Hi,

I understand better.
In fact it is designed this way (and some specific coding was done for this).
When you copy an item, it is just a draft and in most cases you'll have to make some changes before realy publishing it.
That's exactly why when you copy an item, the copy is not in the first status (recorded) but in a specific "copy" spatus.
This allows to make some changes (that will update lastUpdateDateTime) before sending emails that are sent on creation of new item.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
12 Jan 2020 13:23 #5 by ozed
I understand !
Thanks for your quick responses
Ozed

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.039 seconds