Roundup Tracker - Issues

Issue 2550964

classification
Title: History can (temporarily) show incorrect value when a change is rejected
Type: behavior Severity: normal
Components: Web interface Versions: devel
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: rouilj
Priority: normal Keywords: patch

Created on 2018-07-07 22:33 by rouilj, last changed 2018-07-07 22:39 by rouilj.

Files
File name Uploaded Description Edit Remove
BLOCK_SUBJECT.py rouilj, 2018-07-07 22:33
Messages
msg6101 Author: [hidden] (rouilj) Date: 2018-07-07 22:33
Set up a classic tracker with the attached detector.

1 Create an issue and save it.
2 Now change the Title and commit the change.

Look at the history and you will see the change recorded. The right
hand side of the change will be the current title (state A).

3 Now change the title to include the word rejectme.

You should see an error:

  Edit Error: subject rejected because keyword rejectme used

if you look at the history at the bottom of the issue, you will see
the new title with the word rejectme where the original title was (state B).

E.G.

at A you see:

2018-07-07 18:06:04	admin	set	title: Do you like foo foo -> Do you like
foo bar
2018-07-07 18:00:36	admin	set	title: Do you like foo -> Do you like foo foo

at B you see:

2018-07-07 18:06:04	admin	set	title: Do you like foo foo -> Do you like
foo bar rejectme
2018-07-07 18:00:36	admin	set	title: Do you like foo -> Do you like foo foo

The rejected title is *not* committed to the database.
This can be seen with roundup-admin history issueX or display issueX.
So this is not the same as issue2550955.

I think the code that preserves changes in the web page is causing the
history mechanism to display the web form data and not the data in the
database.

So the "current" history element that is displayed on the right hand
side is the web form value.

It should be possible to insert TAL before the history generation
section of the template to retrieve/display the database value.
E.G. adding:

<span tal:omit-tag="python:True"
 tal:content="python:utils.set_form_wins(request.client,False)">
<span>

before the call to context.history in the template seems to fix it
in my test. So need to add to every template.

Fixing the rejected change fixes this issue. As a result I consider this
a cosmetic issue, so not marking it as a blocker.
msg6102 Author: [hidden] (rouilj) Date: 2018-07-07 22:39
Realised that tal code is calling a function that I added to my
extensions/template.py file.

Add:

def set_form_wins(client,value):
    '''set client's form_wins attribute to the boolean value
       passed in.
    '''
    client.form_wins=value

to the file and add:

    instance.registerUtil('set_form_wins', set_form_wins)

to the init() function in the file.
History
Date User Action Args
2018-07-07 22:39:44rouiljsetmessages: + msg6102
2018-07-07 22:33:25rouiljcreate