Feature Request: Code Insert to controller for redirect #923

Closed
opened 2022-06-27 23:22:17 +00:00 by cpaschen · 4 comments
cpaschen commented 2022-06-27 23:22:17 +00:00 (Migrated from github.com)

Per some previous tickets, at times the form on the front-end doesn't always redirect properly when submitted.

This requires manually adding some code in the controller, in the save() and cancel() functions, right before the return, something like this:

/***[REPLACED$$$$]***//**10**/
            $linkAuthorDash = Kr_booksHelper::getSystemParam('syslink_dashboard');
            $this->setRedirect((JRoute::_($linkAuthorDash)));
/***[/REPLACED$$$$]***/

It would be nice (and avoid this custom code) if we could either have a way to set the redirect on the form manually or to just be able to insert code in this location via the GUI.

BTW... in the example above the form is set to always redirect to a link saved in the programs system parameters; however, on a couple other occasions I'm setting a session variable to store the return location (on the previous form) and then getting that session value to set the redirect like this. Maybe not 'graceful' but it solves the issue with redirects not working properly with the standard JCB generated code.

Per some previous tickets, at times the form on the front-end doesn't always redirect properly when submitted. This requires manually adding some code in the controller, in the save() and cancel() functions, right before the return, something like this: ``` /***[REPLACED$$$$]***//**10**/ $linkAuthorDash = Kr_booksHelper::getSystemParam('syslink_dashboard'); $this->setRedirect((JRoute::_($linkAuthorDash))); /***[/REPLACED$$$$]***/ ``` It would be nice (and avoid this custom code) if we could either have a way to set the redirect on the form manually or to just be able to insert code in this location via the GUI. BTW... in the example above the form is set to always redirect to a link saved in the programs system parameters; however, on a couple other occasions I'm setting a session variable to store the return location (on the previous form) and then getting that session value to set the redirect like this. Maybe not 'graceful' but it solves the issue with redirects not working properly with the standard JCB generated code.
cpaschen commented 2022-06-27 23:23:15 +00:00 (Migrated from github.com)

Sorry, that should be /[INSERT]/ (not replace)

Sorry, that should be /***[INSERT]***/ (not replace)
Member

UPDATE ... I just found that this can be added to the postSaveHook area via the GUI code insert for handling the after-save redirect.

And to handle the re-direct on cancel, the redirect code can be added to the script-after cancel area.

So no changes are needed to avoid the INSERT/REPLACE code.

I'm closing this as there's really no need for any changes to make this work.

UPDATE ... I just found that this can be added to the postSaveHook area via the GUI code insert for handling the after-save redirect. And to handle the re-direct on cancel, the redirect code can be added to the script-after cancel area. So no changes are needed to avoid the INSERT/REPLACE code. I'm closing this as there's really no need for any changes to make this work.
Member

Looks like I can't close my own issue here.

Please go ahead and close this.

Looks like I can't close my own issue here. Please go ahead and close this.

Yes for all the issues migrated... you could link your github account to your account here, and I am not absolutly sure if it will, but I think that will give you back the control of your issues. (let me know if you need help with that)

Anyway no problem I can close this for you.

Yes for all the issues migrated... you could link your github account to your account here, and I am not absolutly sure if it will, but I think that will give you back the control of your issues. (let me know if you need help with that) Anyway no problem I can close this for you.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#923
No description provided.