To reproduce:
- Install HEAD Drupal
- Click on "Administrator"
- Click on "Taxonomy"
- On the "Tags" vocabulary, click "list terms".
Result:
Fatal error: Uncaught exception 'PDOException' with message 'SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = ? - Array ( [0] => 10 [1] => 0 [2] => [3] => 1 ) SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' in /srv/w*a/htdocs/d1/includes/database/database.inc:365 Stack trace: #0 /srv/w*a/htdocs/d1/includes/database/database.inc(1154): DatabaseConnection->query('SELECT count(*)...', Array, Array) #1 /srv/w*a/htdocs/d1/modules/taxonomy/taxonomy.admin.inc(289): db_query('SELECT count(*)...', 10, 0, NULL, '1') #2 [internal function]: taxonomy_overview_terms(Array, Object(stdClass)) #3 /srv/w*a/htdocs/d1/includes/form.inc(360): call_user_func_array('taxonomy_overvi...', Array) #4 [internal function]: drupal_retrieve_form('taxonomy_overvi...', Array, Object(stdClass)) #5 /srv/w* in /srv/w*a/htdocs/d1/includes/database/database.inc on line 365
Expected result:
Display an empty list of terms.
Robin
Comments
Comment #1
asimmonds CreditAttribution: asimmonds commentedThe exception is generated because more than one parameter is passed to db_query() when only one is expected.
The bug also appears to be in 6.x
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedCrazy. It is possible that this fixes #23687: New pager code broken taxonomy pagers and / or #292073: Long hierarchies not displayed on Taxonomy admin page?
Comment #3
catchThis will need to be re-rolled with named placeholders after dbtng. Bumping to critical too.
Comment #4
pp CreditAttribution: pp commentedI test it and re-rolled with named placeholders. It's work, and simpletest not found error.(62 passes, 0 fails, 0 exceptions)
I maked the patch. (I hope it is good)
I don't know what should be make with db_rewrite.
Comment #5
Zothos CreditAttribution: Zothos commentedchanging status to something better.
Comment #6
Dries CreditAttribution: Dries commentedPatch looks good. IMO, we should take this opportunity to write a test for it.
Comment #7
catchThis is a very quick test which simply clicks around the admin/content/taxonomy interface for the default Article vocabulary. Courtesy of the EOL Taxonomy Sprint. Hopefully this is enough to get the bug fix in (assertResponse registers valid HTML despite the exception, but then subsequent checks fail) - since it's a fatal error on my system. I'm planning to write some small admin UI patches this week which are dependent on this page working, and will fill out the tests for this section at the same time.
Comment #8
mlncn CreditAttribution: mlncn commented#7 Applies and does it.
Comment #9
catchRe-rolled for offset since the granularity patch just went in :)
Comment #10
mlncn CreditAttribution: mlncn commentedThis patch adds to the previous another test: "Ensure terms can be edited from administration page and that term name and description are saved. (Advanced options are not tested.)"
Note: As this little addition to a small patch is my most significant contribution to date, and my first Simpletest, I tried to document everything: http://agaricdesign.com/note/testing-a-patch-and-adding-a-simpletest
benjamin, Agaric Design Collective
Comment #11
Robin Monks CreditAttribution: Robin Monks commented#10 left out the fix to the actual issue :)
Robin
Comment #12
mlncn CreditAttribution: mlncn commented@Robin: Details! ;-)
Rerolling, WITH the other files, and a cleanup of a comment / note to self and a better intro text.
As soon as this gets in we can make a test for http://drupal.org/node/305740 (edit tab when viewing term lists)
benjamin, Agaric Design Collective
Comment #13
mlncn CreditAttribution: mlncn commentedOne more time! This is the same patch with the category -> term changes (from another issue of Catch's) and the set title for admin term pages (also for another patch, and we'll probably be doing it differently, that I left in) removed.
Comment #14
mlncn CreditAttribution: mlncn commentedOne last reroll, with the edit term form test cleaned up to follow test-writing standards.
Comment #15
mlncn CreditAttribution: mlncn commentedGood god, man, here are your blasted capitalized sentence comments with "full stops" (known on this side of the Atlantic as periods, by the way).
Comment #16
catchSo I reviewed this patch sitting next to Ben at the taxonomy sprint, works great, tests the specific page which was broken and adds some more. There's some weirdness in taxonomy.test in general, but that's not for here. RTBC!
Comment #17
mlncn CreditAttribution: mlncn commentedBased on comments from webchick in IRC: Now with PHPDoc and an @TODO about the fact that AssertText failed where AssertRaw worked (and no HTML entities being converted, which only one explanation: poltegeists).
Comment #18
mlncn CreditAttribution: mlncn commentedReviewed live in real time at the Encyclopedia Of Life Taxonomy Code Sprint!
Comment #19
webchickCommitted to D7. Looks like asimmond's in #1 also needs review for D6.
Comment #20
catch#1 should be RTBC for both 6 and 5.
Comment #21
Damien Tournoud CreditAttribution: Damien Tournoud commentedThese two new tests were 99 and 100. Congratulations guys... we now have 100 test cases!!!!
Comment #22
Alice Heaton CreditAttribution: Alice Heaton commentedHi,
People have been asking whether this fixes http://drupal.org/node/292073 - well I've just tested the patch in comment #17 (and also the one in #1) and neither fix the problem mentioned. (However issue #292073 does provide a patch itself - no need to look elsewhere!)
Thanks,
Anselm
Comment #23
catchStill valid for D6, but it doesn't blow up there - just fails silently, so demoting from critical.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm going to say this is a won't fix. D6 commits focus on security fixes at this point.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedChanging issue status to reflect that it was fixed in 7.x.