after some interesting segfault errors, now submitting the right hand form

master
Marek Isalski 7 years ago
parent dc5a71e7f5
commit 563e17ba58

@ -498,13 +498,14 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
return $form;
}
function _fulcrm_shoppingcart_drupal_get_form_with_form_state( $form_id, $form_state ) {
$args = func_get_args();
function fulcrm_shoppingcart_buy_eventbookingtype_guest_form_submit( $form, &$form_state ) {
die( print_r( $form_state, 1 ) );
}
array_shift( $args ); // Remove $form_id from the arguments.
array_shift( $args ); // Remove $form_state from the arguments.
$form_state[ 'build_info' ][ 'args' ] = $args;
return drupal_build_form( $form_id, $form_state );
function fulcrm_shoppingcart_buy_eventbookingtype_guest_form( $form, &$form_state, $person, $eventbookingtype, $product ) {
$form = fulcrm_shoppingcart_buy_eventbookingtype_form( $form, $form_state, $person, $eventbookingtype, $product );
$form[ 'actions' ][ 'submit' ][ '#submit' ] = array( 'fulcrm_shoppingcart_buy_eventbookingtype_guest_form_submit' );
return $form;
}
function fulcrm_shoppingcart_buy_eventbookingtype_login_form_submit( $form, &$form_state ) {
@ -515,7 +516,6 @@ function fulcrm_shoppingcart_buy_eventbookingtype_login_form_submit( $form, &$fo
function fulcrm_shoppingcart_buy_eventbookingtype_login_form( $form, &$form_state, $product_id ) {
$form = user_login( $form, $form_state );
$form_state[ 'fulcrm_shoppingcart' ][ 'redirect_buy_product_id' ] = $product_id;
//$form[ 'actions' ][ 'submit' ][ '#submit' ] = array( 'fulcrm_shoppingcart_buy_eventbookingtype_login_form_submit' );
return $form;
}
@ -531,7 +531,7 @@ function fulcrm_shoppingcart_buy_eventbookingtype( $person, $eventbookingtype, $
if ( user_is_anonymous() ) {
$user_login_form = drupal_get_form( 'fulcrm_shoppingcart_buy_eventbookingtype_login_form', $product_id = $product[ 'id' ] );
$fulcrm_shoppingcart_buy_eventbookingtype_form = drupal_get_form( 'fulcrm_shoppingcart_buy_eventbookingtype_form', $person, $eventbookingtype, $product );
$fulcrm_shoppingcart_buy_eventbookingtype_form = drupal_get_form( 'fulcrm_shoppingcart_buy_eventbookingtype_guest_form', $person, $eventbookingtype, $product );
return theme( 'fulcrm_shoppingcart_buy_eventbookingtype', array( 'fulcrm_shoppingcart_buy_eventbookingtype_form' => $fulcrm_shoppingcart_buy_eventbookingtype_form, 'user_login_form' => $user_login_form ) );
}

Loading…
Cancel
Save