When I edit an audio node and then save it, all the information in the "iTunes specific information" section is deleted. Watchdog reports an error:

Unknown column 'nid' in 'field list' query: INSERT INTO itunes_item (vid, nid, summary, subtitle, explicit, block) VALUES (4347, 4343, '\r\n', 'March 24- March 30, 2009', 0, 0) in /.../includes/common.inc  on line 3477.
CommentFileSizeAuthor
#3 itunes_794494.patch1.02 KBdrewish

Comments

drewish’s picture

ah yeah that could be problematic. do you remember which version you installed first? did you have audio_itunes installed at one point?

yan’s picture

Not sure about the first version I used. And yes, I think audio_itunes was installed before.

drewish’s picture

Status: Active » Fixed
StatusFileSize
new1.02 KB

Okay you'll need to run the following code:

    // Check if the audio module got around to adding a nid field.
    if (!db_column_exists('itunes_item', 'nid')) {
      $nid_field = array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      );
      db_add_field($ret, 'itunes_item', 'nid', $nid_field);

      // Assign nids from the node table.
      $ret[] = update_sql("UPDATE {itunes_item} i INNER JOIN {node} n ON i.vid = n.vid SET i.nid = n.nid");
    }

it'll create the column if it doesn't exist.

I'm committing the attached patch that creates the field if it doesn't exist for other folks like you.

Status: Fixed » Closed (fixed)

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