A more thorough fix for #745 and #940. Stop using the referer to

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:
Bharat Mediratta
2009-12-31 17:21:19 -08:00
parent a018e6235f
commit 20bd09ff00
8 changed files with 43 additions and 24 deletions

View File

@@ -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;
}
}