Hi,

I have one use case. I need to redirect user to confirmation form when they saves the node. I have tried in below ways, but which didn't work for me.

Approach 1:

  • In hook_form_alter, I have added new submit function by array_unshift(). When my submit function getting call, I am redirecting that user to my confirmation form.
  • When it get redirect, the content is getting save and then its getting redirect
  • I need to redirect node, before it get save.

Approach 2:

  • I have created a Drupal ajax(#ajax) for the submit button. when ajax getting call, that moment itself my node is getting save.

Approach 3:

  • On submit, I have created a ajax callback by jquery, and created a dialog popup. when user says 'yes' to the confirm form, I am triggering the submit function in jquery. But the action attribute in form element having the current path, so my node is not getting save.

Can anyone help me!

Comments

saranya ashokkumar’s picture

Issue tags: +confirmation, +confirmation page
cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

Hello @saranya purushothaman: Nothing can be done without a look at the code.

cilefen’s picture

Title: Confirmation form for node save. » How to create a confirmation form for node save
saranya ashokkumar’s picture

Hi cilefen,
Thanks For Your Reply!

Actually what I need is, I want to create a confirmation form for node save like delete.

cilefen’s picture

Status: Postponed (maintainer needs more info) » Fixed
saranya ashokkumar’s picture

I have tried that. For delete operation, they are declaring this class in annotation of the entity("delete" operation) or by hook_entity_type_alter().

I want the same for save. But in annotation operations of entity, there is no save operation to define my class.

saranya ashokkumar’s picture

Status: Fixed » Active
cilefen’s picture

Hi. Please be aware that we do not normally work on support requests in this issue queue—there are forums and stack exchange for that. If you think you have identified a bug in Drupal core, please identify how to reproduce it. As yet you have not posted any code so there is not a way we can help except to point you to documentation.

qqboy’s picture

$(SAVE_BUTTON).click(function(){
if(confirm(Drupal.t("MESSAGES?"))){
return true;
}else{
return false;
}
});

bhanuprakashnani’s picture

Assigned: Unassigned » bhanuprakashnani
bhanuprakashnani’s picture

Please give me steps to follow to solve the issue. Haven't got a complete idea. Thank you.

Rutuj’s picture

You can create a webform "confirmation form" and use "rules" module to add a action before saving new node.
Action could be:- redirect to path. In our case it is "confirmation form".

apaderno’s picture

Assigned: bhanuprakashnani » Unassigned
Status: Active » Fixed
Issue tags: -confirmation, -confirmation page

I am closing this support request as per comment #9. If you need support for sites you maintain/develop, or for modules you develop, ask in the forums.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.