Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#42896 closed defect (fixed)

Could not sort tickets by status

Reported by: xeron (Ivan Larionov) Owned by: admin@…
Priority: Normal Milestone:
Component: server/hosting Version:
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Trac web interface shows error when I'm trying to sort tickets by status:

Report execution failed:
ORDER BY "status" is ambiguous LINE 10: ...lue, milestone, severity, time ) AS tab ORDER BY "status" A... ^

Example link: report:9?sort=status&asc=1

Sorting by any other field works: report:9?sort=ticket&asc=1

Also status field shown 2 times. May be related.

Attachments (1)

Screenshot 2014-03-17 22.36.08.png (181.5 KB) - added by xeron (Ivan Larionov) 11 years ago.

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by xeron (Ivan Larionov)

comment:1 Changed 11 years ago by mf2k (Frank Schima)

Cc: skarulkar@… added
Component: websiteserver/hosting
Keywords: trac removed
Owner: changed from jmpp@… to wsiegrist@…

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:3 Changed 10 years ago by jmroot (Joshua Root)

Cc: skarulkar@… removed
Owner: changed from wsiegrist@… to admin@…

comment:4 Changed 9 years ago by petrrr

Is this still an issue or can this be closed?

comment:5 Changed 9 years ago by xeron (Ivan Larionov)

You can easily verify it. I've provided a link which results in a error.

Last edited 9 years ago by xeron (Ivan Larionov) (previous) (diff)

comment:6 Changed 8 years ago by xeron (Ivan Larionov)

Fixed with a new trac. Feel free to close.

The only issue which is remaining is Status field shown twice.

Last edited 8 years ago by xeron (Ivan Larionov) (previous) (diff)

comment:7 Changed 8 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: newclosed

Thanks for the notice. Any idea why the status field is listed twice?

comment:8 Changed 8 years ago by xeron (Ivan Larionov)

Not really. Last time I managed trac installation was like 8 years ago :)

comment:9 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Report 9 was selecting the status column twice:

SELECT p.value AS __color__,
    id AS ticket, summary, component, version, milestone, t.status,
    t.type AS type, severity,
    owner, status,
    priority, time AS created,
    changetime AS _changetime, description AS _description,
    reporter AS _reporter
FROM ticket t, enum p
WHERE t.status <> 'closed'
AND p.name = t.priority AND p.type = 'priority' AND reporter = '$USER'
ORDER BY (status = 'assigned') DESC, p.value, milestone, severity, time

And also selecting the severity column, which we don't use. I changed it to:

SELECT p.value AS __color__,
    id AS ticket, summary, component, version, milestone,
    t.type AS type,
    owner, status,
    priority, time AS created,
    changetime AS _changetime, description AS _description,
    reporter AS _reporter
FROM ticket t, enum p
WHERE t.status <> 'closed'
AND p.name = t.priority AND p.type = 'priority' AND reporter = '$USER'
ORDER BY (status = 'assigned') DESC, p.value, milestone, time

Same with report 10:

SELECT p.value AS __color__,
    id AS ticket, summary, component, version, milestone, t.status,
    t.type AS type, severity,
    owner, status,
    priority, time AS created,
    changetime AS _changetime, description AS _description,
    reporter AS _reporter
FROM ticket t, enum p
WHERE p.name = t.priority AND p.type = 'priority' AND reporter = '$USER'
ORDER BY (status = 'assigned') DESC, p.value, milestone, severity, time

I changed it:

SELECT p.value AS __color__,
    id AS ticket, summary, component, version, milestone,
    t.type AS type,
    owner, status,
    priority, time AS created,
    changetime AS _changetime, description AS _description,
    reporter AS _reporter
FROM ticket t, enum p
WHERE p.name = t.priority AND p.type = 'priority' AND reporter = '$USER'
ORDER BY (status = 'assigned') DESC, p.value, milestone, time
Note: See TracTickets for help on using tickets.