EOL Taxonomy Sprint: Taxonomy returns PDOException on "list terms" on clean HEAD install

Robin Monks - September 1, 2008 - 00:54
Project:Drupal
Version:6.x-dev
Component:taxonomy.module
Category:bug report
Priority:normal
Assigned:agaric
Status:needs review
Description

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

#1

asimmonds - September 1, 2008 - 06:52
Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
302440.patch1.26 KBIgnoredNoneNone

#2

Damien Tournoud - September 1, 2008 - 07:08

#3

catch - September 1, 2008 - 08:49
Priority:normal» critical
Status:needs review» needs work

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

#4

pp - September 1, 2008 - 12:01

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.

AttachmentSizeStatusTest resultOperations
302440-2.patch2.04 KBIgnoredNoneNone

#5

Zothos - September 4, 2008 - 16:57
Status:needs work» needs review

changing status to something better.

#6

Dries - September 5, 2008 - 10:24

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

#7

catch - September 8, 2008 - 21:04
Title:Taxonomy returns PDOException on "list terms" on clean HEAD install» EOL Taxonomy Sprint: Taxonomy returns PDOException on "list terms" on clean HEAD install

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.

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_test.patch8.33 KBIgnoredNoneNone

#8

agaric - September 8, 2008 - 21:29
Status:needs review» reviewed & tested by the community

#7 Applies and does it.

#9

catch - September 8, 2008 - 21:51

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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_test.patch8.37 KBIgnoredNoneNone

#10

agaric - September 9, 2008 - 22:10
Status:reviewed & tested by the community» needs review

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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch4.22 KBIgnoredNoneNone

#11

Robin Monks - September 9, 2008 - 23:57
Status:needs review» needs work

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

Robin

#12

agaric - September 10, 2008 - 16:59
Assigned to:Anonymous» agaric
Status:needs work» needs review

@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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch10.69 KBIgnoredNoneNone

#13

agaric - September 10, 2008 - 19:52

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.

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch6.16 KBIgnoredNoneNone

#14

agaric - September 11, 2008 - 16:31

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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch6.14 KBIgnoredNoneNone

#15

agaric - September 11, 2008 - 17:39

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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch6.1 KBIgnoredNoneNone

#16

catch - September 11, 2008 - 18:35
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!

#17

agaric - September 11, 2008 - 19:10
Status:reviewed & tested by the community» needs review

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

AttachmentSizeStatusTest resultOperations
taxonomy_list_plus_admin_and_edit_term_tests.patch6.46 KBIgnoredNoneNone

#18

agaric - September 11, 2008 - 19:22
Status:needs review» reviewed & tested by the community

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

#19

webchick - September 11, 2008 - 19:48
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.

#20

catch - September 12, 2008 - 17:06

#1 should be RTBC for both 6 and 5.

#21

Damien Tournoud - September 14, 2008 - 14:24

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

#22

Anselm Heaton - September 22, 2008 - 11:02

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

#23

catch - December 28, 2008 - 01:16
Priority:critical» normal

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

 
 

Drupal is a registered trademark of Dries Buytaert.