Open GoogleCodeExporter opened 8 years ago
(correction on above cut n paste)
Ian ->
Yes – that looks like the issue. These ids should have been initialised in the
function initFieldIds($db) in BugzillaQuery.php. Could you put debug logging on
(http://www.mediawiki.org/wiki/Extension:Bugzilla_Reports#Troubleshooting) and
see if
this method is running through. You should see a log line saying “Registering
field
ids” if it is.
Barak->
Getting this to screen:
Registering field ids : 57
And seems ok as SELECT * FROM bugs.fielddefs f; also returns 57 rows…
Thanks for helping so far, I’m not a PHP guy :-)
Original comment by ian.homer@gmail.com
on 31 May 2010 at 8:49
Do you see in the log after this a list of all the fields registered, e.g.
Registering field id bug_status = 9
if not then perhaps it's not loading the field ids. To help you further I
probably
need to simulate your set up ... although I suspect this is roughly where the
issue
may lie.
Original comment by ian.homer@gmail.com
on 31 May 2010 at 9:02
Barak -> Another question – why the generated SQL contains this in the where
clause:
and bug_status’CLOSED’ ? A reminder, I’m looking for bugs closed in the
last week.
Original comment by ian.homer@gmail.com
on 31 May 2010 at 9:11
That does look odd - I'd expect an "="s to be there
Original comment by ian.homer@gmail.com
on 31 May 2010 at 9:12
replying to comment #2 - yes, this is field is registered:
Registering field idbug_status -> 9
Original comment by barak.ya...@gmail.com
on 1 Jun 2010 at 6:49
OK - I think I'll need to spin up a similar set up to you and test this out.
Original comment by ian.homer@gmail.com
on 1 Jun 2010 at 7:19
10x - waiting... :-)
Original comment by barak.ya...@gmail.com
on 1 Jun 2010 at 1:10
I'm trying to debug the code - I found that in BugzillaQuery.php when coming to
execute this code:
if ($this->isRequired("closed")) {
$sql.=" LEFT JOIN ".
" (SELECT bug_id, MAX(bug_when) as bug_when from ".
$this->connector->getTable("bugs_activity").
" where fieldid=".$this->fieldIds["bug_status"].
" and added='CLOSED' GROUP BY bug_id) as closedactivity on
bugs.bug_id=closedactivity.bug_id";
}
$this->fieldIds is NULL. Can it be null if the debug mode reports that the
fields
got registered?
Original comment by barak.ya...@gmail.com
on 3 Jun 2010 at 9:59
I think issue resolved.
1. In BugzillaQuery::initFieldIds() I've substitued BugzillaQuery::$fieldIds
with
$this->fieldIds
2. in the query, I explicity added "status=CLOSED" (since default is !CLOSED -
maybe
default should considred if the user queries for closed bugs :-))
Original comment by barak.ya...@gmail.com
on 3 Jun 2010 at 10:32
Barak - thanks for working through this (and apologies for not being able to
help out
more on it - been a bit hectic over the last few days).
If that does the job then, great. I was hoping for the
BugzillaQuery::$fieldIds to
be a static access the variables - I guess $this->fieldIds accesses the static
variable as well, but puzzled as to why the static access didn't work,
especially
since we set the variables with
BugzillaQuery::$fieldIds[$line["name"]]=$line["id"];
On point 2 - absolutely the default !CLOSED shouldn't be set if the user
queries for
closed bugs.
Original comment by ian.homer@gmail.com
on 4 Jun 2010 at 7:25
Original issue reported on code.google.com by
ian.homer@gmail.com
on 31 May 2010 at 8:46