Article

Drupal 7 Missing tables in Newsletter Module installation - PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '.field_data_field_newsletter_template

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '.field_data_field_newsletter_template

Strange but for some reason, installing the newsletter module produces error below. All seems fine, with the module installed and enabled. However, error appears when clicking on the list from the newsletter administration backend - /admin/config/media/newsletter/lists

message

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database_prodd7.field_data_field_newsletter_template' doesn't exist: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {newsletter_list} lists INNER JOIN {field_data_field_newsletter_template} template_field ON lists.nlid = template_field.entity_id INNER JOIN {newsletter_template} templates ON template_field.field_newsletter_template_target_id = templates.ntid) subquery; Array ( ) in PagerDefault->execute() (line 74 of /home/website/public_html/includes/pager.inc).

Upon closer inspection of the database, and comparing it to a clean, local installation, the following tables seems to be missing. Therefore, exporting these from a local database copy then re-importing these to production seems to have worked.

  • field_data_field_newsletter_list
  • field_data_field_newsletter_template

Default Newsletter module tables that should be present in the installation:

field_data_field_list_description
field_data_field_newsletter_body
field_data_field_newsletter_categories
field_data_field_newsletter_list
field_data_field_newsletter_template
 
field_revision_field_list_description
field_revision_field_newsletter_body
field_revision_field_newsletter_categories
field_revision_field_newsletter_list
field_revision_field_newsletter_template
 
newsletter_list
newsletter_newsletter
newsletter_subscriber
newsletter_template

IMPORTANT! Perform lots of database backups beforehand for easy reversion in case above does not work. Hope this helps

Comments

You saved my ass! :) Thanks so much!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
12 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.