2

I recently upgraded from 4.7.11 to 4.7.14 in a Drupal 7 installation. Now I have noticed that when trying to create a new Mailing, the page shows nothing.

This message appears in the log file:

nativecode=1054 ** Unknown column 'language' in 'field list'

The "INSERT INTO" statement doesn't mention 'language', but the DB error does. Why would that happen?

I checked that database table civicrm_mailing, and there is a field called "language".

Where else could be 'language' be needed? What else can I do to work out what the problem is?

This is the whole report from the log file:

Dec 13 16:01:12  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , unsubscribe_id , resubscribe_id , optout_id , name , mailing_type , from_name , from_email , replyto_email , subject , body_text , body_html , url_tracking , forward_replies , auto_responder , open_tracking , override_verp , created_id , created_date , visibility , dedupe_email ) VALUES ( 1 ,  1 ,  2 ,  7 ,  5 ,  8 ,  6 ,  NULL , 'standalone' , '{name}' , '{email_address}' ,  NULL ,  NULL ,  NULL ,  NULL ,  1 ,  0 ,  0 ,  1 ,  1 ,  1 ,  20161213160112 , 'Public Pages' ,  1 )  [nativecode=1054 ** Unknown column 'language' in 'field list']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , unsubscribe_id , resubscribe_id , optout_id , name , mailing_type , from_name , from_email , replyto_email , subject , body_text , body_html , url_tracking , forward_replies , auto_responder , open_tracking , override_verp , created_id , created_date , visibility , dedupe_email ) VALUES ( 1 ,  1 ,  2 ,  7 ,  5 ,  8 ,  6 ,  NULL , 'standalone' , '{name}' , '{email_address}' ,  NULL ,  NULL ,  NULL ,  NULL ,  1 ,  0 ,  0 ,  1 ,  1 ,  1 ,  20161213160112 , 'Public Pages' ,  1 )  [nativecode=1054 ** Unknown column 'language' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , unsubscribe_id , resubscribe_id , optout_id , name , mailing_type , from_name , from_email , replyto_email , subject , body_text , body_html , url_tracking , forward_replies , auto_responder , open_tracking , override_verp , created_id , created_date , visibility , dedupe_email ) VALUES ( 1 ,  1 ,  2 ,  7 ,  5 ,  8 ,  6 ,  NULL , 'standalone' , '{name}' , '{email_address}' ,  NULL ,  NULL ,  NULL ,  NULL ,  1 ,  0 ,  0 ,  1 ,  1 ,  1 ,  20161213160112 , 'Public Pages' ,  1 )  [nativecode=1054 ** Unknown column 'language' in 'field list']"]
)

Here is the backtrace:

Dec 13 16:01:12  [info] $backTrace = #0 /home/mysite/sites/all/modules/civicrm/CRM/Core/Error.php(932): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /home/mysite/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /home/mysite/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...")
#4 /home/mysite/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, NULL, NULL, "INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...", "DB_Error", TRUE)
#6 /home/mysite/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /home/mysite/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /home/mysite/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...", "DB_Error", TRUE)
#9 /home/mysite/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'language' in 'field list'")
#10 /home/mysite/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/mysite/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...")
#12 /home/mysite/sites/all/modules/civicrm/packages/DB/DataObject.php(2438): DB_common->query("INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...")
#13 /home/mysite/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_mailing (domain_id , header_id , footer_id , reply_id , u...")
#14 /home/mysite/sites/all/modules/civicrm/CRM/Core/DAO.php(487): DB_DataObject->insert()
#15 /home/mysite/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php(1585): CRM_Core_DAO->save()
#16 /home/mysite/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php(1703): CRM_Mailing_BAO_Mailing::add((Array:33), (Array:0))
#17 [internal function](): CRM_Mailing_BAO_Mailing::create((Array:33))
#18 /home/mysite/sites/all/modules/civicrm/api/v3/utils.php(1279): call_user_func_array((Array:2), (Array:1))
#19 /home/mysite/sites/all/modules/civicrm/api/v3/Mailing.php(67): _civicrm_api3_basic_create("CRM_Mailing_BAO_Mailing", (Array:33))
#20 /home/mysite/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_mailing_create((Array:27))
#21 /home/mysite/sites/all/modules/civicrm/Civi/API/Kernel.php(161): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#22 /home/mysite/sites/all/modules/civicrm/Civi/API/Kernel.php(92): Civi\API\Kernel->runRequest((Array:7))
#23 /home/mysite/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Mailing", "create", (Array:10), NULL)
#24 /home/mysite/sites/all/modules/civicrm/CRM/Utils/REST.php(404): civicrm_api("Mailing", "create", (Array:10))
#25 /home/mysite/sites/all/modules/civicrm/CRM/Utils/REST.php(641): CRM_Utils_REST::process((Array:3), (Array:8))
#26 [internal function](): CRM_Utils_REST::ajax()
#27 /home/mysite/sites/all/modules/civicrm/CRM/Core/Invoke.php(276): call_user_func((Array:2))
#28 /home/mysite/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:12))
#29 /home/mysite/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#30 /home/mysite/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#31 [internal function](): civicrm_invoke("ajax", "rest")
#32 /home/mysite/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#33 /home/mysite/index.php(22): menu_execute_active_handler()
#34 {main}
9
  • Be careful what you post on a public forum. I have removed the personal information (though unfortunately it is still available in the post revisions). Commented Dec 13, 2016 at 18:51
  • Could you try enabling "Administer => System Settings => Debugging => Display Backtrace"? Then create a new mailing. It might provided a more detailed log.
    – Tim Otten
    Commented Dec 13, 2016 at 21:24
  • I have the backtrace, and tried to include it in original post, but found it wouldn't post as it was flagged as spam. I'll see if I can edit it in. Commented Dec 13, 2016 at 23:34
  • The query runs fine on a civicrm database with or without language column. Can you try clearing cache : yoursite.org/civicrm/menu/rebuild?reset=1 ? Also, can you confirm that you are on a single language installation ?
    – samuelsov
    Commented Dec 14, 2016 at 14:25
  • I have tried clearing the cache, and get the same result. Commented Dec 14, 2016 at 16:01

2 Answers 2

3

One thing i have found is that if you have the detailed logging turned on under the misc settings, this kind of error can show if the log_civicrm_mailing table doesn't have the language column. This can suggest there was something that went wrong in the upgrade.

I would recommend you check to see if there is a log_civicrm_mailing table and if that has the language column if not add it as the same as in the civicrm_mailing table. Then go to http(s):///civicrm/menu/rebuild?reset=1&triggerRebuild=1

3
  • Brilliant! Thank you. Language was not in log_civicrm_mailing. I turned off Misc->Logging to check, and found that I could start a new mailing. I then turned on Misc->Logging, and found that I could still start a new mailing. There is now a language column in the log_civicrm_mailing table. Just turning logging on again must have fixed those tables. Commented Dec 15, 2016 at 13:55
  • Wow, thanks @Seamus Lee for having spotted that !
    – samuelsov
    Commented Dec 15, 2016 at 19:34
  • 1
    @TonyMichael I suspect that by turning it off and on you triggered the function in CiviCRM that scans the logging tables and adds any columns missing to logging tables alters any to match what is in civicrm_x or set any columns in the logging tables to be NULL for any columns that the log table has that no longer exists in the civicrm_x table
    – Seamus Lee
    Commented Dec 15, 2016 at 20:15
2

It sounds as if you haven't updated the database after upgrading CiviCRM.

CiviCRM 4.7.13 added a new column 'language' to the 'civicrm_mailing' table.

You can update the database by visiting this URL:

http://<your_drupal_home>/civicrm/upgrade?reset=1

Full details here: Run the upgrade script

Alternatively if you have drush you can run drush cvupdb. See this post for more details: Is it easy to upgrade CiviCRM using drush?

1
  • 1
    Thanks, but I have run the upgrade step. I have checked the civicrm_mailing table and see the language column in there. Commented Dec 13, 2016 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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