hPostObjectEdit
This hook allows a plugin to observe or alter an object which has been edited by the user, and redirect them to an alternative page after the edit operation.
The replacementObject
must be created using mutableCopy()
of the given object
.
hPostObjectEdit is called before hLabelObject or hLabelUpdatedObject.
Arguments
Name | Type | Description |
object |
StoreObject |
The object being edited |
previous |
StoreObject |
The previous version of the object, or null |
Response
Return information by changing these properties of the response
object.
Name | Type | Description |
replacementObject |
StoreObject |
An object to store in place of the edited object, or null for no effect |
redirectPath |
String |
If set, the user will be redirected to this path instead of the newly edited object |
continueEditingWithMessage |
String |
Set to a string to prevent the object being saved, and present it for editing again with the given message displayed prominently. |
JavaScript template
P.hook('hPostObjectEdit', function(response, object, previous) { // Respond to hook, for example // response.replacementObject = ... });