Revert "Fix for ticket #1118. Create a item::save_with_retries helper

method, which encapsulates saving an item and handling name and slug
conflicts. Call this instead of doing a save directly."

Rolled this back because it fails KISS.  We already have an API for
saving models with Item_Model::save() that's consistent with all of
our other model code.  Adding a new way to save items is confusing and
inconsistent.

This reverts commit 9504f71efc.
This commit is contained in:
Bharat Mediratta
2010-06-15 17:17:25 -07:00
parent 8fb56abf03
commit 48dc07dbc8
3 changed files with 14 additions and 21 deletions
@@ -65,16 +65,12 @@ class Simple_Uploader_Controller extends Controller {
if (array_key_exists("extension", $path_info) &&
in_array(strtolower($path_info["extension"]), array("flv", "mp4"))) {
$item->type = "movie";
} else {
$item->type = "photo";
}
item::save_with_retries($item);
if ($item->type == "movie") {
$item->save();
log::success("content", t("Added a movie"),
html::anchor("movies/$item->id", t("view movie")));
} else {
$item->type = "photo";
$item->save();
log::success("content", t("Added a photo"),
html::anchor("photos/$item->id", t("view photo")));
}