If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Can't use attachments.thedata as a field name when using old saved search

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Query/Bug List
--
minor
RESOLVED FIXED
11 years ago
7 years ago

People

(Reporter: Paul, Assigned: Max Kanat-Alexander)

Tracking

(Depends on: 1 bug)

2.23.3
Bugzilla 4.2
Dependency tree / graph
Bug Flags:
approval +

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

v2
432 bytes, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
(Reporter)

Description

11 years ago
on bmo I clicked on one of my saved queries and got an error message instead of my results:

Bugzilla has suffered an internal error. Please save this page and send it to bugzilla-admin@mozilla.org with details of what you were doing at the time this message appeared. 

URL: https://bugzilla.mozilla.org/buglist.cgi?cmdtype=runnamed&namedcmd=bugs%20with%20my%20patches2

Can't use attachments.thedata as a field name.

Comment 1

11 years ago
This would help if you gave us the "non-encrypted" url: -> Edit Search -> Search, then paste the URL in the URL field instead of the current one.
(Assignee)

Updated

11 years ago
Severity: major → normal
OS: Windows 2000 → All
Hardware: PC → All
Summary: Can't use attachments.thedata as a field name. → Can't use attachments.thedata as a field name when using old saved search
(Reporter)

Comment 2

11 years ago
There is no "Edit Search" because I get an error.
(Reporter)

Comment 3

11 years ago
I have shared the search so that you can run it.

"bugs with my patches2"

Updated

10 years ago
Depends on: 389815

Updated

10 years ago
Depends on: 389820

Comment 4

10 years ago
Here's the query I have.

https://bugzilla.mozilla.org/query.cgi?bug_file_loc=
bug_file_loc_type=substring
bug_id=
bugidtype=include
chfieldfrom=
chfieldto=Now
chfieldvalue=
email1=
email2=
emailassigned_to1=1
emailassigned_to2=1
emailqa_contact2=1
emailreporter2=1
emailtype1=substring
emailtype2=substring
field0-0-0=attachments.thedata
field0-1-0=attachments.ispatch
field0-2-0=flagtypes.name
keywords=
keywords_type=allwords
long_desc=
long_desc_type=substring
query_format=advanced
query_type=advanced
resolution=---
short_desc=%20%20
short_desc_type=substring
status_whiteboard=
status_whiteboard_type=substring
type0-0-0=changedby
type0-1-0=equals
type0-2-0=equals
value0-0-0=timeless%40bemail.org
value0-1-0=1
value0-2-0=review%2B
votes=
known_name=patched

Note that using edit doesn't really work because it strips all the interesting bits resulting in a query that gives absolute garbage. It's a shared query, so you can watch it fail.

Here's where it came from:
https://bugzilla.mozilla.org/query.cgi?bug_file_loc=&bug_file_loc_type=substring&bug_id=&bugidtype=include&chfieldfrom=&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field0-0-0=attachments.thedata&field0-1-0=attachments.ispatch&field0-2-0=flagtypes.name&keywords=&keywords_type=allwords&long_desc=&long_desc_type=substring&query_format=advanced&query_type=advanced&resolution=---&short_desc=%20%20&short_desc_type=substring&status_whiteboard=&status_whiteboard_type=substring&type0-0-0=changedby&type0-1-0=equals&type0-2-0=equals&value0-0-0=timeless%40bemail.org&value0-1-0=1&value0-2-0=review%2B&votes=&known_name=patched

If I try running it directly:
https://bugzilla.mozilla.org/buglist.cgi?bug_file_loc=bug_file_loc_type=substringbug_id=bugidtype=includechfieldfrom=chfieldto=Nowchfieldvalue=email1=email2=emailassigned_to1=1emailassigned_to2=1emailqa_contact2=1emailreporter2=1emailtype1=substringemailtype2=substringfield0-0-0=attachments.thedatafield0-1-0=attachments.ispatchfield0-2-0=flagtypes.namekeywords=keywords_type=allwordslong_desc=long_desc_type=substringquery_format=advancedquery_type=advancedresolution=---short_desc=%20%20short_desc_type=substringstatus_whiteboard=status_whiteboard_type=substringtype0-0-0=changedbytype0-1-0=equalstype0-2-0=equalsvalue0-0-0=timeless%40bemail.orgvalue0-1-0=1value0-2-0=review%2Bvotes=known_name=patched
bugzilla goes off munching in the weeds.

I tried running it from query, and I end up with this:
https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=bug_file_loc_type%3Dsubstringbug_id%3Dbugidtype%3Dincludechfieldfrom%3Dchfieldto%3DNowchfieldvalue%3Demail1%3Demail2%3Demailassigned_to1%3D1emailassigned_to2%3D1emailqa_contact2%3D1emailreporter2%3D1emailtype1%3Dsubstringemailtype2%3Dsubstringfield0-0-0%3Dattachments.thedatafield0-1-0%3Dattachments.ispatchfield0-2-0%3Dflagtypes.namekeywords%3Dkeywords_type%3Dallwordslong_desc%3Dlong_desc_type%3Dsubstringquery_format%3Dadvancedquery_type%3Dadvancedresolution%3D---short_desc%3D++short_desc_type%3Dsubstringstatus_whiteboard%3Dstatus_whiteboard_type%3Dsubstringtype0-0-0%3Dchangedbytype0-1-0%3Dequalstype0-2-0%3Dequalsvalue0-0-0%3Dtimeless%40bemail.orgvalue0-1-0%3D1value0-2-0%3Dreview%2Bvotes%3Dknown_name%3Dpatched&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=
(In reply to comment #4)
> field0-0-0=attachments.thedata

This is the problem. This field was renamed to attach_data.thedata in bug 305333 so the old query obviously fails. Loading the query in query.cgi shows this field with --- because it can't be matched to anything. Changing it to "Attachment data" produces correct query with attach_data.thedata as the field name.

Yet another example how using raw database field names in the search URL is bad.

Comment 6

10 years ago
Created attachment 274338 [details] [diff] [review]
would this work?
Assignee: query-and-buglist → timeless
Status: NEW → ASSIGNED
Attachment #274338 - Flags: review?(wicked)
Comment on attachment 274338 [details] [diff] [review]
would this work?

Looks like answer is "no" and even if this would work for running old Saved Searches (buglist.cgi with cmdtype=runnamed) then it wouldn't fix editing old searches (query.cgi, saved or otherwise) or using a direct link to buglist.cgi with old field name.
Attachment #274338 - Flags: review?(wicked) → review-
(Assignee)

Comment 8

7 years ago
Created attachment 516640 [details] [diff] [review]
v2

This will fix it, although I don't know how many people will still need this fix.
Assignee: timeless → mkanat
Attachment #274338 - Attachment is obsolete: true
Attachment #516640 - Flags: review+
(Assignee)

Updated

7 years ago
Severity: normal → minor
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
(Assignee)

Comment 9

7 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search.pm
Committed revision 7736.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.