fix for UUID error

master
Marek Isalski 6 years ago
parent 76e54b427e
commit 207812aa8a

@ -523,21 +523,24 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form_submit( $form, &$form_sta
if ( array_key_exists( 'ticket_for_persons', $form_state[ 'values' ] ) ) {
$ticket_for_persons = $form_state[ 'values' ][ 'ticket_for_persons' ];
if ( !is_array( $ticket_for_persons ) )
$ticket_for_persons = array( $ticket_for_persons );
foreach ( $ticket_for_persons as $ticket_for_person ) {
$add_person_name = 'unnamed person';
if ( $ticket_for_person === 'myself' ) {
$add_person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'name' ];
} else {
$add_person_uuid = fulcrm_crypto_get_object_id_form_value( 'person.uuid', $ticket_for_person );
$ticket_for_persons = array( $ticket_for_persons => 1 );
foreach ( $ticket_for_persons as $ticket_for_person => $add ) {
if ( $add ) {
$add_person_name = 'unnamed person';
if ( $ticket_for_person === 'myself' ) {
$add_person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'name' ];
} else {
$add_person_uuid = fulcrm_crypto_get_object_id_form_value( 'person.uuid', $ticket_for_person );
if ( $add_person_uuid )
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'persons' ][ $add_person_uuid ][ 'name' ];
}
if ( $add_person_uuid )
$add_person_name = $form_state[ 'fulcrm_shoppingcart' ][ 'persons' ][ $add_person_uuid ][ 'name' ];
_fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart,
$add_person_uuid, $add_person_name, $product_id,
$made_choices = $made_choices );
}
_fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart,
$add_person_uuid, $add_person_name, $product_id,
$made_choices = $made_choices );
}
} else {
if ( $person_uuid ) {

Loading…
Cancel
Save