I'm only just getting into TDD with Drupal and unfortunately run into trouble right away. For some reason the simpletest####field_config table isn't being created, and I don't get why; many other tables do get created. The (seemingly) relevant part of the error I get is:

Base table or view not found: 1146 Table 'mcdonalds.simpletest405637field_config&#039

coming from /modules/field/field.crud.inc (that is the project's root modules folder, NOT the modules folder in any theme or something).

I'm a bit stuck here, so I hope someone can tell me how to debug this, or even how to solve, that would be great of course;) Thanks!


The issue is definitely related to cache backends.

Disable cache backends if you are testing using Simpletest classes.

| improve this answer | |

It's not that the table doesn't get created, it's that something is reaching for field info before the table is there. That's not unheard of. What you need to do is use a debugger or file_put_contents('/tmp/log', print_r(debug_backtrace(), TRUE)); and take a good look of where field info gets called. Something leaks into the install that simpletest runs.

| improve this answer | |
  • Hm, well that gives me some indications, but it doesn't really help. The generated trace stops in the settings file, but nothing interesting seems to be happening there, there are no functions being called, only vars defined. Any idea what I could be doing wrong in the settings file causing anything to annoy the db? – Jasper Kennis Apr 2 '13 at 13:37
  • Correction, it stops in includes/bootstrap.inc where it calls include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';. – Jasper Kennis Apr 2 '13 at 13:44
  • Uh what's in your settings.php? Can you scrub passwords from it and make available as a .txt somewhere? – user49 Apr 2 '13 at 18:20
  • Yes, here you go, but I'm guessing the log should go somewhere else? – Jasper Kennis Apr 3 '13 at 11:05

I was having the same issue. Following the discussion above I found that while I had File Cache disabled, I still had $conf['cache_backends'] and $conf['cache_default_class'] defined in my settings.php file. Commenting out those lines fixed the issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.