Problem:
I try to create an activity for a customer and system crashed with the following error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_task_ref_target_id' cannot be null: INSERT INTO {field_data_field_task_ref} (entity_type, entity_id, revision_id, bundle, delta, language, field_task_ref_target_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 46 [:db_insert_placeholder_2] => 46 [:db_insert_placeholder_3] => erpal_crm_activity [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 451 of /home2/nicvisa2/crm.local/modules/field/modules/field_sql_storage/field_sql_storage.module).

Fix 1:
In the "advanced" section of the Activity I chose a task and it accepted my activity which led to another issue with date_item module (see below)

Rippled error:
Call to undefined method DateTime::getTimestamp on line 623 date_item.module

Fix 2:
updating to latest dev version did NOT help.
Changing line 623 from
return $date->getTimestamp();
to
return $date->format("U");
fixed this problem.

It's be nice if developers would look into fixing this.

Comments

nicrox’s picture

Issue summary: View changes
drupallerina’s picture

i am running into the same error and am getting around it temporarily by deactivating the "Create and add CRM task" checkboxes at admin/erpal/crm

mgifford’s picture

On enabling & disabling "Create and add CRM task on insert" I was NOT able to repeat this error.

I haven't seen the other error yet.

manuelBS’s picture

Status: Active » Fixed

I tried to reproduce this but without success. This only happenes if your settings at /admin/erpal/basic and at /admin/erpal/crm are not set. This will be done during the installation process.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.