mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-10 05:29:13 -04:00
guess how to send the user back. Instead, proxy the originating item id through the edit forms so that we can tell exactly what page we were on when we began editing. If we were viewing the item, then redirect to its new url (in case it changed) to fix ticket #745. But if we were viewing some other item, then just stay on the current page to fix #940. The page_type approach didn't work because you'd have the same "collection" page_type when doing a context menu edit for an album.
This commit is contained in:
@@ -133,13 +133,21 @@ class Quick_Controller extends Controller {
|
||||
|
||||
switch ($item->type) {
|
||||
case "album":
|
||||
return print album::get_edit_form($item);
|
||||
$form = album::get_edit_form($item);
|
||||
break;
|
||||
|
||||
case "photo":
|
||||
return print photo::get_edit_form($item);
|
||||
$form = photo::get_edit_form($item);
|
||||
break;
|
||||
|
||||
case "movie":
|
||||
return print movie::get_edit_form($item);
|
||||
$form = movie::get_edit_form($item);
|
||||
break;
|
||||
}
|
||||
|
||||
// Pass on the source item where this form was generated, so we have an idea where to return to.
|
||||
$form->hidden("from_id")->value((int)Input::instance()->get("from_id", 0));
|
||||
|
||||
print $form;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user