I have a CCK 3rd party video field, "field_video". I create a video node with a YouTube 3rd party link & custom thumbnail, then try to edit & save:

User warning: Column 'field_video_status' cannot be null query: UPDATE content_type_talk SET vid = 4733, nid = 63, field_recording_date_value = '2010-04-08 00:00:00', field_talk_title_value = 'Cómo pensar una ciudad', field_video_embed = 'http://www.youtube.com/watch?v=lXGY0X-wdjI&feature=player_embedded', field_video_value = 'lXGY0X-wdjI', field_video_provider = 'youtube', field_video_data = (...), field_video_status = NULL, field_video_version = 3, field_video_duration = 1150 WHERE vid = 4733 in _db_query() (line 141 of C:\Inetpub\wwwroot\xxx.com\includes\database.mysqli.inc).

(I trimmed the field_video_data. (...)).

The problem is this: field_video_status = NULL, which cannot be null. Must be 0 or 1. In my db table, this is always 1.

Comments

Anonymous’s picture

'status' => array('description' => "The availability status of this media.", 'type' => 'int', 'unsigned' => 'TRUE', 'not null' => TRUE, 'default' => EMFIELD_STATUS_AVAILABLE),

emfield.cck.inc declares not null => TRUE for status?
So why is the UPDATE query field_status = null?

I don't know what this does in emfield.module:

  if ($info['module'] && module_hook($info['module'], 'emfield_status')) {
    $item['status'] = module_invoke($info['module'], 'emfield_status', $item, $field, $module);
  }

There is no other reference of "emfield_status" anywhere else, so what is it trying to invoke? Seems like a missing function?

Anonymous’s picture

I turned that last bit into this:

  if ($info['module'] && module_hook($info['module'], 'emfield_status')) {
    $item['status'] = module_invoke($info['module'], 'emfield_status', $item, $field, $module);
  } else {
    $item['status'] = EMFIELD_STATUS_AVAILABLE;
  }

Temporary solution, but I don't understand what it's supposed to be looking for.

alex ua’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure this isn't coming from media_youtube?

cafuego’s picture

I've hit the same problem with emfield_audio using the SoundCloud provider.

The generated query is:

UPDATE content_type_mission_assignment SET vid = 879, nid = 785, field_completed_value = 1, field_mission_nid = 558, field_mission_audio_embed = NULL, field_mission_audio_value = NULL, field_mission_audio_provider = NULL, field_mission_audio_data = NULL, field_mission_audio_status = 1, field_mission_audio_version = NULL, field_mission_audio_title = NULL, field_mission_audio_description = NULL, field_mission_video_embed = NULL, field_mission_video_value = NULL, field_mission_video_provider = NULL, field_mission_video_data = NULL, field_mission_video_status = 1, field_mission_video_version = NULL, field_mission_video_title = NULL, field_mission_video_description = NULL, field_mission_video_duration = NULL WHERE vid = 879;

The table definition is:

Create Table: CREATE TABLE `content_type_mission_assignment` (
  `vid` int(10) unsigned NOT NULL DEFAULT '0',
  `nid` int(10) unsigned NOT NULL DEFAULT '0',
  `field_mission_nid` int(10) unsigned DEFAULT NULL,
  `field_completed_value` int(11) DEFAULT NULL,
  `field_mission_video_embed` longtext,
  `field_mission_video_value` varchar(255) DEFAULT NULL,
  `field_mission_video_provider` varchar(255) DEFAULT NULL,
  `field_mission_video_data` longtext,
  `field_mission_video_status` int(10) unsigned NOT NULL DEFAULT '1',
  `field_mission_video_version` int(10) unsigned NOT NULL DEFAULT '0',
  `field_mission_video_title` varchar(255) DEFAULT NULL,
  `field_mission_video_description` varchar(255) DEFAULT NULL,
  `field_mission_video_duration` int(10) unsigned NOT NULL DEFAULT '0',
  `field_mission_audio_embed` longtext,
  `field_mission_audio_value` varchar(255) DEFAULT NULL,
  `field_mission_audio_provider` varchar(255) DEFAULT NULL,
  `field_mission_audio_data` longtext,
  `field_mission_audio_status` int(10) unsigned NOT NULL DEFAULT '1',
  `field_mission_audio_version` int(10) unsigned NOT NULL DEFAULT '0',
  `field_mission_audio_title` varchar(255) DEFAULT NULL,
  `field_mission_audio_description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`vid`),
  KEY `nid` (`nid`),
  KEY `field_mission_nid` (`field_mission_nid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

And MySQL says ERROR 1048 (23000): Column 'field_mission_audio_version' cannot be null

cafuego’s picture

... and now on a (non-mandatory) video field as well. Same issue for these fields:

  • _video_status
  • _video_version
  • _video_duration

The fix posted in comment #2 didn't resolve my issue. I altered the table definition to allow NULLs and that's sorted it.

joel_guesclin’s picture

I just encountered the same problem, plus this which still seems to be outstanding.