Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've started working on this and are at like 80% now. I will finish this somewhere this week.
Comments
Comment #1
Crell CreditAttribution: Crell commentedIt's somewhat more than a week... :-) Are you still working on this, or should someone else jump in?
Comment #2
R.Muilwijk CreditAttribution: 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 CreditAttribution: Crell commentedThis is open for anyone who wants it.
Comment #4
Dave ReidComment #5
tizzo CreditAttribution: tizzo commentedWorking on this now!
Comment #6
Ryan Palmer CreditAttribution: 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 CreditAttribution: Ryan Palmer commentedNoticed that just after I submitted it... otherwise ok? (rerolled)
Comment #9
Ryan Palmer CreditAttribution: 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 CreditAttribution: Ryan Palmer commentedOh really! I've been doing it wrong all this time!
Thanks for the help.
Comment #13
Ryan Palmer CreditAttribution: Ryan Palmer commentedLooks like it failed.. not sure why. Try this once more.
Comment #14
tizzo CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: phoolish commentedHere is the dblog.admin.inc Still having issues with setHeader and setCountQuery, but simpletest seems to pass.
Comment #21
tizzo CreditAttribution: tizzo commentedI'll roll this patch into the one I'm repairing as per Crell's comments above.
Comment #22
tizzo CreditAttribution: tizzo commentedSorry for the delay! Patch re-rolled with bubbasan's patch and Crell's comments above implemented. Hopefully this works!
Comment #23
tizzo CreditAttribution: 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 CreditAttribution: tizzo commentedChanging title to reflect that this patch is for the whole dblog module and not just dblog.admin.inc
Comment #25
Dries CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: Dries commentedFair enough. Committed to CVS HEAD.
Comment #46
Dries CreditAttribution: Dries commented