Answers.Body: <p>seems doable using <a href="https://www.drupal.org/project/inline_entity_form" rel="nofollow noreferrer">https://www.drupal.org/project/inline_entity_form</a>.</p>
  <p>Steps I followed was:</p>
  <ul>
  <li>Enable <code>Location Block</code>, <code>Address</code> &amp; <code>Event</code> Entities in CiviCRM Entity Settings page.</li>
  <li>Ensure module weight for CiviCRM Entity is lower than <code>Inline entity form</code>.</li>
  </ul>
  <pre><code>drush ev 'module_set_weight(&quot;civicrm_entity&quot;, -10);'
  </code></pre>
  <ul>
  <li><p>Rebuild cache (<code>drush cr</code>) 2-3 times before proceeding for the next step.</p>
  </li>
  <li><p>Structure =&gt; CiviCRM Entity =&gt; CiviCRM Location block =&gt; Manage Form Display</p>
  </li>
  <li><p>Enable Address ID field and ensure Widget is set to <code>Inline entity form</code>.
  <a href="https://i.sstatic.net/PjNVv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PjNVv.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>Similarly, enable Location Block ID field and set the widget to <code>Inline entity form</code> in Structure =&gt; CiviCRM Entity =&gt; CiviCRM Event =&gt; Manage Form Display</p>
  </li>
  <li><p>Visit the form at <code>/civicrm-event/add</code> to create events</p>
  </li>
  </ul>
  <p>Note: APIv3 requires contact_id and location_type_id field while creating address in civicrm. The former is not required while creating address for events so can be considered as an api bug.</p>
  <p>Ensure these 2 fields are present on the Address entity to avoid any fatal error on the form submission.</p>
  <p><a href="https://i.sstatic.net/sxQeH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sxQeH.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-31T06:05:50.097Z
Answers.Text: Just a note that this does work to some extent, but you can't search for an existing  address. The location block doesn't know any of the details of the address, so search isn't possible.
Answers.UserDisplayName: Nick Perkins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-12T11:11:34.100Z
Answers.LastActivityDate: 2024-03-13T12:06:00.300Z
Answers.LastEditDate: 2024-03-13T12:06:00.300Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I have enabled the CiviCRM Entity module. How can we create an event location and event in CiviCRM using a single form submission?</p>
  <p>This functionality was achievable in Drupal 7 using <a href="https://skvare.com/blog/civicrm-entity-and-drupal-integration-whats-new-whats-next" rel="nofollow noreferrer">https://skvare.com/blog/civicrm-entity-and-drupal-integration-whats-new-whats-next</a>.</p>
  <p>Is there a way to achieve the same in Drupal 8/9/10?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-27T15:15:37.210Z
Comments.Text: Interested in this as well.
Comments.UserDisplayName: Dave T
Tags: <civievent><civicrm-entity><drupal-9>
Title: Drupal 9/10: How to create Event Location + Events using CiviCRM Entity
ThreadText: # Drupal 9/10: How to create Event Location + Events using CiviCRM Entity
  
  (Asked by: username_0 on 2024-03-12)
  
  I have enabled the CiviCRM Entity module. How can we create an event location and event in CiviCRM using a single form submission?
  
  This functionality was achievable in Drupal 7 using <https://skvare.com/blog/civicrm-entity-and-drupal-integration-whats-new-whats-next>.
  
  Is there a way to achieve the same in Drupal 8/9/10?
  
  **Tags:** civievent, civicrm-entity, drupal-9
  
  > **Comments:**
  > **username_1**: Interested in this as well.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-03-12. Score: 5 | Accepted answer
  
  seems doable using <https://www.drupal.org/project/inline_entity_form>.
  
  Steps I followed was:
  
  * Enable `Location Block`, `Address` & `Event` Entities in CiviCRM Entity Settings page.
  * Ensure module weight for CiviCRM Entity is lower than `Inline entity form`.
  
  ```
  drush ev 'module_set_weight("civicrm_entity", -10);'
  
  ```
  
  * Rebuild cache (`drush cr`) 2-3 times before proceeding for the next step.
  * Structure => CiviCRM Entity => CiviCRM Location block => Manage Form Display
  * Enable Address ID field and ensure Widget is set to `Inline entity form`.
    [![enter image description here](https://i.sstatic.net/PjNVv.png)](https://i.sstatic.net/PjNVv.png)
  * Similarly, enable Location Block ID field and set the widget to `Inline entity form` in Structure => CiviCRM Entity => CiviCRM Event => Manage Form Display
  * Visit the form at `/civicrm-event/add` to create events
  
  Note: APIv3 requires contact\_id and location\_type\_id field while creating address in civicrm. The former is not required while creating address for events so can be considered as an api bug.
  
  Ensure these 2 fields are present on the Address entity to avoid any fatal error on the form submission.
  
  [![enter image description here](https://i.sstatic.net/sxQeH.png)](https://i.sstatic.net/sxQeH.png)
  
  > **Comments:**
  > **username_2**: Just a note that this does work to some extent, but you can't search for an existing  address. The location block doesn't know any of the details of the address, so search isn't possible.  
  
  ---
  
  