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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asimmonds’s picture

Status: Active » Needs review
FileSize
1.26 KB

The 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

Damien Tournoud’s picture

catch’s picture

Priority: Normal » Critical
Status: Needs review » Needs work

This will need to be re-rolled with named placeholders after dbtng. Bumping to critical too.

pp’s picture

FileSize
2.04 KB

I 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.

Zothos’s picture

Status: Needs work » Needs review

changing status to something better.

Dries’s picture

Patch looks good. IMO, we should take this opportunity to write a test for it.

catch’s picture

Title: Taxonomy returns PDOException on "list terms" on clean HEAD install » EOL Taxonomy Sprint: Taxonomy returns PDOException on "list terms" on clean HEAD install
FileSize
8.33 KB

This 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.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

#7 Applies and does it.

catch’s picture

Re-rolled for offset since the granularity patch just went in :)

mlncn’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
4.22 KB

This 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

Robin Monks’s picture

Status: Needs review » Needs work

#10 left out the fix to the actual issue :)

Robin

mlncn’s picture

Assigned: Unassigned » mlncn
Status: Needs work » Needs review
FileSize
10.69 KB

@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

mlncn’s picture

One 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.

mlncn’s picture

One last reroll, with the edit term form test cleaned up to follow test-writing standards.

mlncn’s picture

Good god, man, here are your blasted capitalized sentence comments with "full stops" (known on this side of the Atlantic as periods, by the way).

catch’s picture

Status: Needs review » Reviewed & tested by the community

So 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!

mlncn’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
6.46 KB

Based 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).

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed live in real time at the Encyclopedia Of Life Taxonomy Code Sprint!

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Needs review

Committed to D7. Looks like asimmond's in #1 also needs review for D6.

catch’s picture

#1 should be RTBC for both 6 and 5.

Damien Tournoud’s picture

These two new tests were 99 and 100. Congratulations guys... we now have 100 test cases!!!!

Alice Heaton’s picture

Hi,

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

catch’s picture

Priority: Critical » Normal

Still valid for D6, but it doesn't blow up there - just fails silently, so demoting from critical.

Anonymous’s picture

Status: Needs review » Closed (won't fix)

I'm going to say this is a won't fix. D6 commits focus on security fixes at this point.

Anonymous’s picture

Version: 6.x-dev » 7.x-dev
Status: Closed (won't fix) » Closed (fixed)

Changing issue status to reflect that it was fixed in 7.x.