mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-07 07:30:57 -04:00
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:
@@ -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")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user