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.
It should use a pager_query. Loading all terms is not really feasible with freetagging. As I have not touched the original code just indented it and tested the -- rather trivial -- patch for freetagging, I dare to submit this as RTBC. Other issues will follow as we face this nice vocabulary of 179487 terms
Comment | File | Size | Author |
---|---|---|---|
#9 | taxo_6.patch | 3.25 KB | bdragon |
#8 | taxo_5.patch | 3.15 KB | bdragon |
#4 | taxo_4.patch | 2.97 KB | chx |
taxo_3.patch | 2.8 KB | chx | |
Comments
Comment #1
drummThe code that is there already looks a bit shaky. I think it would be best to clean it out rather than add another layer. Here is what I see:
* A couple lines commented FIXME that are modifying the pager's globals.
* A conditionally-inserted pager inside the table, which should always be inserted, right after the table.
It looks like the code is already trying to do the right thing with pagers, but stumbling upon not having a real query, which pagers tend to like.
Comment #2
chx CreditAttribution: chx commentedThe tree-displaying code can't really use pager_query without adding some serious amounts of code (you would need to keep some form of materialized path stored, maintained etc) and I have not even touched that. My code just adds a few lines for flat displays which can and should use flat display.
Comment #3
drummOkay, we can go with this general design then. However, lets clean up the code style a little bit. Here are some ideas-
* Flip around the if statement to remove the '!'.
* Use 'h.parent' instead of 'parent'.
* Why are we getting both 't.tid' and 't.*'?
*
'text/'. $variable
instead of"text/$variable"
.Comment #4
chx CreditAttribution: chx commentedI did the first three action points and even added more comments (Dries always wants more comments, so I thought why not :) ). But the fourth action point I am not doing, see almost the end of http://phplens.com/lens/php-book/optimizing-debugging-php.php (or just search on php 4.3 and see what it has to say). I find this version much more readable.
Comment #5
drummCommitted to 5.x with moving the pager outside the table.
Comment #6
yched CreditAttribution: yched commentedShouldn't this go in 6.x as well ?
Comment #7
drummYes.. this needs to be put in 6.x.
Comment #8
bdragon CreditAttribution: bdragon commentedUntested forward port to 6, based on the version committed by drumm.
Comment #9
bdragon CreditAttribution: bdragon commentedThe patch wasn't broken, but it was rolled from the wrong dir.
Comment #10
bdragon CreditAttribution: bdragon commentedComment #11
Crell CreditAttribution: Crell commentedSlight fuzz on applying, but otherwise works. I generated a hundred terms with devel module and got a working pager out of it.
There's still one FIXME line, but it was there before this patch, too. Let's commit it.
Comment #12
Gábor HojtsyGood, thanks. Committed.
Comment #13
(not verified) CreditAttribution: commented