Commit cec68602 authored by Thomas Nilsson's avatar Thomas Nilsson
Browse files

Issue #3200737 by sl27257, bachbach, TLWatson: make the related_flag id unique

parent 937cec87
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -144,22 +144,27 @@ function flag_lists_update_8004() {
      $database->update('flagging')
        ->fields(['flag_id' => $newName])
        ->condition('flag_id', $originalId)
        ->distinct()
        ->execute();
      $database->update('flag_counts')
        ->fields(['flag_id' => $newName])
        ->condition('flag_id', $originalId)
        ->distinct()
        ->execute();
      $database->update('flagging_collection_field_data')
        ->fields(['relatedflag' => $newName])
        ->condition('id', $entity_id)
        ->distinct()
        ->execute();
      $database->update('flagging_collection_field_revision')
        ->fields(['relatedflag' => $newName])
        ->condition('id', $entity_id)
        ->distinct()
        ->execute();
      $database->update('flag_list_item_field_data')
        ->fields(['baseflag' => $newName])
        ->condition('baseflag', $originalId)
        ->distinct()
        ->execute();
      // Update the name of the Related Flag by creating a new
      // and delete the old. The deletion must be done after all