Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Aug 2008 at 13:42 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Crell commentedIt's somewhat more than a week... :-) Are you still working on this, or should someone else jump in?
Comment #2
R.Muilwijk commentedSorry, I'll put in on top of my list for next thursday. We have open source thursday at our company so should have plenty of time then.
Comment #3
Crell commentedThis is open for anyone who wants it.
Comment #4
dave reidComment #5
tizzo commentedWorking on this now!
Comment #6
Ryan Palmer commentedAlso working on this atm. Can somebody give me a quick sanity check to see if I'm doing this right? tx!
Comment #7
dave reid$max = db_query('SELECT MAX(wid) FROM {watchdog}')->fetchObject();should use ->fetchResult();
Comment #8
Ryan Palmer commentedNoticed that just after I submitted it... otherwise ok? (rerolled)
Comment #9
Ryan Palmer commentedComment #10
dave reidforeach ($results AS $object) {should just be lowercase 'as' :)
Other than that, it looks ok. I don't have anything to test that it actually works, but I guess the testbot can help us there.
Comment #12
Ryan Palmer commentedOh really! I've been doing it wrong all this time!
Thanks for the help.
Comment #13
Ryan Palmer commentedLooks like it failed.. not sure why. Try this once more.
Comment #14
tizzo commented[Edit] Sorry, hadn't refreshed the page in a while. I think my patch applies and all tests pass. Big frown on duplicate work but I guess we'll all get a little more experience with DBTNG!
[Edit Edit] Durp! Also I missed the admin.inc, oh well! Hopefully your patch works!
Comment #16
tizzo commentedFixed up a few other things in admin.inc, I do think everything is done and working now. All pretty straightforward stuff, switched all of the while loops to foreach.
[Edit - I found a problem with my setup that caused that fail, I also realized that none of us have updated the test. Working on that now]
Comment #18
tizzo commentedOk, I think I have this working. Really this time.
Went through the test file and updated that as well as fixing my previous issue (and typos that accompanied it).
Comment #19
Crell commentedThe foreach block can be replaced with $ides = db_query()->fetchCol(); I believe that appears twice.
This can also be condensed into just fetchCol().
And of course there's still a pager query.
Comment #20
phoolish commentedHere is the dblog.admin.inc Still having issues with setHeader and setCountQuery, but simpletest seems to pass.
Comment #21
tizzo commentedI'll roll this patch into the one I'm repairing as per Crell's comments above.
Comment #22
tizzo commentedSorry for the delay! Patch re-rolled with bubbasan's patch and Crell's comments above implemented. Hopefully this works!
Comment #23
tizzo commentedRolled a cleaner patch, not sure if the last one would have worked or not but I think this one will.
Comment #24
tizzo commentedChanging title to reflect that this patch is for the whole dblog module and not just dblog.admin.inc
Comment #25
dries commentedCommitted to CVS HEAD. Thanks!
Comment #26
dave reidThe recent log events tablesort is now completely broken and sorting by filter does not work as well. I'm looking into fixing it.
Comment #27
dave reidThis at least gets the table sort working. Filtering is still broken completely.
Comment #28
dave reidNote to anyone doing DBTNG conversion. To convert table sorts, you must do:
These have to be separate lines and cannot be chained. This happened in dblog, poll, and comment.
Comment #29
dave reidLeft in an unwanted debugging statement.
Comment #30
dave reidComment #31
Crell commentedThat seems wrong then. I know I ran into a case where ordered mattered, but you should be able to extend in a chain as long as you do assign back to $query at the end.
Comment #32
dave reidThat seems like it would work. Comparing:
to:
The latter is easier for me to see what is going on. I also remember something about some parts of db_select not able to be chained (fields and conditions?), but I guess it depends on what we're deciding is our offical DBTNG syntax.
Comment #33
Crell commentedI believe the standard is "chain whenever possible", because it's easier to read overall. addField() and addExpression() are not chainable, neither are the join*() methods. extend() ischainable, however, the returned object is the extender, not the original query, so if you don't call ->execute() in that chain then you have to assign back to $query, otherwise the extending object gets lost.
Comment #34
dave reidComment #35
berdirSame here,
Comment #36
berdirRe-roll.
Comment #38
berdirRe-rolled.
Also cleaned up a few queries that didn't early extend, even if they were working correctly.
Comment #40
berdirRe-roll.
Comment #42
berdirRe-roll, forgot to change a setHeader() call...
Comment #43
dries commentedShould we write tests for this?
Comment #44
berdirWe have generic paging tests and we have tests for the functionality of those pages. Moshe was against writing paging tests for every page where we used it, see #394582-8: DBTNG: Tracker module.
I'd say that with the new early extend CS, it is unlikely that it is used wrong and usually, we don't protect against wrong usage of our API.
Comment #45
dries commentedFair enough. Committed to CVS HEAD.
Comment #46
dries commented