Never delete data before upgrading them. This need to be fixed or many loose important data.

function nodewords_update_6117() {
  $ret[] = update_sql("DELETE FROM {nodewords} WHERE type IN ('views', 'panels')");
  if (db_affected_rows()) {
    drupal_set_message(t('The support for Views, and Panels have been changed; visit the <a href="@admin_page">administration page</a> to edit the meta tags for those pages.', array('@admin_page' => url('admin/content/nodewords/global/other'))));
  }

  return $ret;
}

Comments

avpaderno’s picture

Priority: Critical » Normal

If you know of a method that allows to pass from the view ID to its relative URL (and that is reliable), I will be happy to change the code.

hass’s picture

Not taken a look to the code, but only deleting all data and configuration can only be wrong. page_manager_pages.path should be a save value. Cannot speak for views.

izmeez’s picture

subscribing

avpaderno’s picture

Status: Active » Closed (won't fix)

As nobody has been able to provide a system to upgrade the meta tags to use the view path rather than the view ID, I am marking this report as won't fix.

Please re-open this report if you can provide code to update the meta tags.

joachim’s picture

I know very little about how nodewords works, or what it needs from other modules, but the $view object has a get_path() method.

nicolash’s picture

Category: bug » feature
Status: Closed (won't fix) » Active

This will come a bit late for most, but I had to migrate the views meta tags from D5 to D6 recently and the snippet below seems to achieve it.

It assumes that you still have the old D5 database handy and can connect to it from the current D6 install, as outlined here.

Run this in Devel execute PHP or put it in a module update hook.

I'm still testing this and might refine it as well as doing the same with Panels. Hope it helps someone.

kiamlaluno, I'm opening the issue again as you suggested. If you're interested in including this in nodewords' install file, let me know and I'll provide a patch.

db_set_active('d5');

$result = db_query("
  SELECT vv.vid, vv.name viewname, vv.url, nw.name tagtype, nw.content FROM nodewords nw
  JOIN view_view vv ON vv.vid = nw.id
  WHERE nw.type = 'views'
  AND vv.page = 1
");

db_set_active('default');

while ($nw = db_fetch_object($result)) {

  // We only want one entry here per description and keywords.
  if ($nw->vid != $last_vid) {
    $record1 = array(
      'name'    => $nw->viewname,
      'path'    => $nw->url,
      'weight'  => 0,
      'enabled' => 1,
    );
    drupal_write_record('nodewords_custom', $record1);
  }

  $content = serialize(array('value' => $nw->content));
  $record2 = array(
    'type'    => 10,
    'id'    => $record1['pid'],
    'name'  => $nw->tagtype,
    'content' => $content,
  );

  drupal_write_record('nodewords', $record2);

  $last_vid = $nw->vid;
}
nicolash’s picture

Title: Upgrade path for views and panels is missing (data loss) » Upgrade path for views and panels

Title change...

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, which is for a not supported Drupal version.