
RedirectAfterUpdate
RedirectAfterUpdate
i use $x->RedirectAfterInsert = "some page.php"; to change redirect but is there RedirectAfterUpdate or RedirectAfterDelete 

Re: RedirectAfterUpdate
No, though I plan to add these in future releases.




Re: RedirectAfterUpdate
is there any improvements on this feature ?
-
- Posts: 10
- Joined: 2014-03-31 22:28
Re: RedirectAfterUpdate
This does cause issues. The redirect to addnew after an update takes it to an update page where you save changes. If the user doesn't notice and enters new records, the records disappear. This can cause integrity issues for the program because people make these kind of mistakes all the time. Any plan on updating this soon to allow redirectafterupdate or redirectafterdelete?
-
- AppGini Super Hero
- Posts: 85
- Joined: 2014-06-14 03:08
- Location: India
- Contact:
Re: RedirectAfterUpdate
Hi,
Are you sure that redirecting after update will cause some issues related to permissions.
The issue might be some thing like, not updating user records table after update. But I think it may not be an issue, as record will be already inserted into user records table when inserted, redirecting after update may not cause a issue i think.
This may be bit confusing.
I think only Ahmad can tell what will be the issue if we put redirect statement after update..
Are you sure that redirecting after update will cause some issues related to permissions.
The issue might be some thing like, not updating user records table after update. But I think it may not be an issue, as record will be already inserted into user records table when inserted, redirecting after update may not cause a issue i think.
This may be bit confusing.
I think only Ahmad can tell what will be the issue if we put redirect statement after update..
Re: Redirect After Update
Has anybody managed to work out a simple/safe method to redirect after update, preferably with a hook of course?
Looking to implement a redirect after update myself and I'm not too proud to borrow somebody else's work if already achieved. Thanks.
Looking to implement a redirect after update myself and I'm not too proud to borrow somebody else's work if already achieved. Thanks.

Re: RedirectAfterUpdate
Code: Select all
header("Location: index.php");
/Giuseppe
Professional Outsourcing Services
Professional Outsourcing Services
Re: RedirectAfterUpdate
That was the first thing I tried but can't get it to work? Not sure why?
This snippet in datalist.php seems to take over and end result is always the same: update and end up on same record in detail view
Have you succeeded in redirect after update? How exactly?
This snippet in datalist.php seems to take over and end result is always the same: update and end up on same record in detail view
Code: Select all
elseif($update_x != ''){
$updated = call_user_func($this->TableName.'_update', $SelectedID);
$update_status = 'record-updated-ok=' . rand();
if($updated === false) $update_status = 'record-updated-error=' . rand();
Re: RedirectAfterUpdate
I figured out a workaround. I needed the user to access the detail view to update their record and after saving be redirected to another page. The URL to edit the record is tablename_view.php?SelectedID=userid (where userid is the record ID). Therefore, add this to header.php on line 1.
After submitting, SelectedID no longer exists in the URL so it redirects back to the page where I want them.
This allows you to set many different options regarding where you want users redirected and the conditions to do so.
Code: Select all
<?php
$mi = getMemberInfo();
if($_GET['SelectedID']){
// show the page
}elseif($mi['groupID'] == '5'){
$return_url = 'mypage.php';
header("Location: $return_url");
}
?>
This allows you to set many different options regarding where you want users redirected and the conditions to do so.
Re: RedirectAfterUpdate
This seems to work
- but you forfeit the record update audit (return = true does not get executed)
- you dont have to put in the condition, it is the exit that forces the redirect to be heeded (I think)
- but you forfeit the record update audit (return = true does not get executed)
- you dont have to put in the condition, it is the exit that forces the redirect to be heeded (I think)
Code: Select all
function cmembers_after_update($data, $memberInfo, &$args){
if($_POST['update_x'] == '1'){
header("Location: index.php");
exit();
}
return TRUE;
}
Re: RedirectAfterUpdate
Mmh, you probably could do a manual record update audit edit