Opened 6 years ago
Closed 6 years ago
#13435 closed defect (fixed)
KIS plugin does not differentiate between <none> and new state
Reported by: | solstice333 | Owned by: | Jon Ashley |
---|---|---|---|
Priority: | highest | Component: | KeepInterfaceSimplePlugin |
Severity: | critical | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
In my ticket workflow, I have it so that at ticket creation, the state of the ticket is <none>
. Once the ticket is created, the state is new
. When I configure [kis_assistant]
to have cc.visible = status != 'new'
, it hides the cc field for both creation of the ticket and the ticket being in the new
state. Conversely, when I configure [kis_assistant]
to have cc.visible = status != '<none>'
, the field is not hidden at all. Ultimately, I just want to hide the cc field at ticket creation, which is what I expect from cc.visible = status != '<none>'
.
Attachments (0)
Change History (10)
comment:1 follow-up: 2 Changed 6 years ago by
comment:2 Changed 6 years ago by
Replying to Jon Ashley:
I was under the impression that "new" was a built-in state in Trac, but I could easily be wrong about that.
new is no longer a required state in Trac 1.2: TracWorkflow#TicketCreateAction. The ticket lifecycle begins with <none>
(prior to creation of a ticket) and ends with closed.
The <none>
workflow state was introduced to give control over the workflow when creating a ticket, and to avoid hacks like TicketCreationStatusPlugin. While the ticket status field will not have value <none>
, I'm pretty sure you'll find ticket['status'] is None
.
comment:3 Changed 6 years ago by
Trac Release: | → 1.2 |
---|
comment:4 Changed 6 years ago by
Cool, thanks for pointing me in the right direction. I dumped out the req.args
to a file and saw what req.args['id']
was. The following works:
from trac.core import * from kis2 import IConfigFunction class CreateState(Component): implements(IConfigFunction) def at_creation(self, req): return not req.args['id'] # req.args['id'] evals to an empty unicode string
comment:6 Changed 6 years ago by
Summary: | KIS plugin does not differntiate between <none> and new state → KIS plugin does not differentiate between <none> and new state |
---|
comment:7 Changed 6 years ago by
Status: | new → accepted |
---|
I think the change in [17184] should fix the issue. status
will now evaluate to an empty string when at ticket creation.
I've tested this on Trac 1.0.9 and Trac 1.2, both of which showed the fault previously. Can you please confirm that this works for you before I close this ticket and create a new release?
Could you post the
[ticket-workflow]
section of your configuration file (or a stripped-down version of the workflow that shows the same problem)?I was under the impression that "new" was a built-in state in Trac, but I could easily be wrong about that.
As a temporary workaround, I suggest creating a user-defined function that returns the ticket creation state. Create a file named something like
CreateState.py
with the following content:and put it in your plugins folder along with kisplugin. After restarting the server, you should have a new CreateState plugin available. Enable that new plugin in the Trac admin panel. This will make a function
at_creation
available to thetrac.ini
kis configuration that returns True if the ticket is at ticket creation, so that you can writecc.visible = !at_creation()
in the configuration file.I have not tested this very much, so please let me know if it works for you.