Hello,

I am using multistep module with uc_hotel . Room booking form having some problem. I have assign it in step 2 but it always come in step 1

Can you help me.

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Priority: Major » Normal

Hi
Please don't flag interoperability with other modules as major, it's not.
Please see http://drupal.org/node/45111.
I don't use multistep form nor now of how it works, can you please post some more details.
Perhaps this belongs in their issue queue?

Lee

cis.drupal’s picture

Hello,

Sorry for the flag as major. I am going to create a website for hotel booking. And i found this module as good . So i feel that if this module fulfill my all needs that's it. You are continually helping me i am very
kind thankful for this.

I am creating the 6 steps for adding an Room type using multistep module.Room type is a content type made by your module uc_hotel. Now i want Room type settings (ex-Default Number Available: ) should appear only in step 2. Currently i have seen that Room type settings form appear in all steps. I am unable to understand since it is a content type and i set this form in step 2 through multistep admin setting but it shown in all steps.

Thanks

larowlan’s picture

Status: Active » Needs review
FileSize
990 bytes

After reading the multistep I can see that for it to work, it requires hotel_booking to implement hook_content_extra_fields for each of the room type settings pane.
At present only the calendar and booking form are nominated and this was to control their display.
The attached patch adds the room and rate panes.
Not sure how this will go as these aren't fields but rather fieldsets - if it doesn't work then I don't think it can be easily done.

cis.drupal’s picture

Hello Larowlan,

Thanks for help. I added the patch .Now it comes under the step given by me that is step 2 . But when i submit the step 2 . It gives me the errror An illegal choice has been detected. Please contact the site administrator.

Thanks

larowlan’s picture

What does it say in your error log at admin->report->recent log entries.
This error usually indicates you've selected a value in a select field that is no longer present in the list of options. Sometimes it can be down to changing the options but not the default value.

LR

cis.drupal’s picture

Hello Larowlan,

Thanks for help. My problem has been solved

1: Room type setting fieldset elements i added individual field of room type setting form
$extras['default_available'] = array(
'label' => t('Default Number Available'),
'description' => t('Default Number Available'),
'weight' => 10,
);

$extras['minimum_occupancy'] = array(
'label' => t('Default Minimum Occupancy Requirement'),
'description' => t('Default Minimum Occupancy Requirement'),
'weight' => 10,
);
And in the form alter i put ->

$form['default_available'] = $form['room']['default_available'];
$form['minimum_occupancy'] = $form['room']['minimum_occupancy'];
$form['capacity'] = $form['room']['capacity'];
$form['smoking'] = $form['room']['smoking'];
unset($form['room']);
So it now individual field of room setting form can have seprate step. I am writing the code if any body will have the problem like this . so it can be solved .

2: An illegal choice is coming due to
$form['rate']['hbrid'] = array(
'#type' => 'radios',
'#title' => t('Base Rate'),
'#required' => TRUE,
'#options' => $rate_types,
'#default_value' => isset($node->hbrid) ? $node->hbrid : $rate_types[0],
);
its default value is coming 0 when we submit form . But the radio button have 2 and 3 value . So when we submit form it have problem in validating required fields. Since it is required field
Thanks

larowlan’s picture

Good work
Can you roll a patch for your changes.
I'll include them in the module with a conditional

 if (module_exists('multistep')) {
  //your code here
}

Others may need this functionality too and if we put this in the module then your client won't be running a hacked version of the module - and hence will readily benefit from any upgrades.
Thanks again

cis.drupal’s picture

FileSize
2.57 KB

Hello Larowlan,

I am attaching the patch for my work.
So when you made these changes in the module please let me know i will update my module.

Thanks
Himmat

larowlan’s picture

FileSize
2.43 KB

Here's the patch to include your changes.
Please review, test and advise if ok to commit.

cis.drupal’s picture

Hello larowlan

We have tested the patch, it is a successfully working.But we have to alter the form also making fieldset disable and make indivisible field for our patch to work.

/*
* Implementation of hook_form_alter().
*/
function mymodule_form_alter(&$form, $form_state, $form_id) {

if($form_id=='hotel_room_type_node_form') {
$form['default_available'] = $form['room']['default_available'];
$form['minimum_occupancy'] = $form['room']['minimum_occupancy'];
$form['capacity'] = $form['room']['capacity'];
$form['smoking'] = $form['room']['smoking'];

$form['hbrid'] = $form['rate']['hbrid'];
$form['hbrmid'] = $form['rate']['hbrmid'];
$form['adult_occupancy_modifiers'] = $form['rate']['occupancy']['adult_occupancy_modifiers'];
$form['child_occupancy_modifiers'] = $form['rate']['occupancy']['child_occupancy_modifiers'];
$form['occupancy_modifiers'] = $form['rate']['occupancy']['occupancy_modifiers'];
unset($form['room']);
unset($form['rate']);
}
}

Thanks
CIS Group