Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] After dulp...
 
Notifications
Clear all

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

5 Posts
2 Users
0 Reactions
2,284 Views
 ozed
(@ozed)
Posts: 3
Active Member
Topic starter
 
[#6443]

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


 
Posted : 11 Jan 2020 18H57
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Sorry, but I don't understand what issue you try and point out with your select.
Please explain.


 
Posted : 11 Jan 2020 19H40
 ozed
(@ozed)
Posts: 3
Active Member
Topic starter
 

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


 
Posted : 11 Jan 2020 22H10
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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.


 
Posted : 12 Jan 2020 1H00
 ozed
(@ozed)
Posts: 3
Active Member
Topic starter
 

I understand !
Thanks for your quick responses
Ozed


 
Posted : 12 Jan 2020 15H23
Share:

Scroll to Top