To create a new booking, the form for that already contains a (required) entity reference field to an existing user (with field_bt_user
). Head over of admin/structure/booking/fields
in your own site to get more details on that.
If you however want to add another username and email field, just use "Add new field" on admin/structure/booking/fields
for both of those fields.
However, as per your "... so that the user is able to register while completing form ..." (as contained in your question), it appears to me that you want an anonymous user to be able to do so. If that's the case, you'll have to decide about how an anonymous user should complete that form, for the required field field_bt_user
. You might think "just make that field no longer required", but I doubt that's a good idea to do, since there must be good reason for this module why that field is required.
Because of what is above, I think you should slightly adapt your workflow regarding that "... so that the user is able to register while completing form ...":
- Step 1: use the Rules module to intercept a path equal to
/admin/structure/booking/add
, if it is entered by an anonymous user, and redirect them to the login page, with an option to register and a Drupal message shown to them like "this path can only be used by authenticated users, try again after login" (piece of cake with Rules).
- Step 2: wait for the login to be completed, and have the authenticated user enter the same path (
/admin/structure/booking/add
) again. When that happens, the Rules Actions in custom rule as in Step 1 will not be executed anymore (since user is authenticated), while the form is not used by an already registered user.
If you can't solve a problem,
then prevent the problem from ever happening again is a typical plan-b ...