2

we successfully managed to get D8.6.2 with CiviCRM up and running.

But when creating a new user by D8-Admin, the user is logged out with error page access denied. The user is created correctly but the session is killed.

Deactivating of Profiles in CiviCRM causes the known error:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.

Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.

Error type: Could not find a valid session key.

When checking the cookies during the user creation process, i see that the session cookies are gone after submitting of the creation form.

We tried to modify this part in civicrm.module:

  • Attach any relevant profile form fields to user registration form. */ function civicrm_form_user_register_form_alter(&$form, &$form_state, $form_id) { $civicrm = \Drupal::service('civicrm');
    $civicrm->initialize(); $html = \CRM_Core_BAO_UFGroup::getEditHTML(NULL, '', NULL, TRUE, TRUE, NULL, FALSE, $civicrm->getCtype());

    // Need to disable the page cache. \Drupal::service('page_cache_kill_switch')->trigger();

    // We need the CiviCRM core Javascript.
    CRM_Core_Resources::singleton()->addCoreResources();

    $form['civicrm_profile_register'] = [ '#markup' => Markup::create($html), '#cache' => [ 'max-age' => 0, ], ]; $form['#validate'][] = '_civicrm_user_register_form_validate'; }

to:

/* \Drupal::service('page_cache_kill_switch')->trigger();*/ to stop the cache from beeing killed, but that had no impact.

Does anyone has an idea, who we can keep the session alive or give us a hint, where the problem might be?

THX Lars

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.