Commit 7b790379 authored by Julian Pustkuchen's avatar Julian Pustkuchen Committed by Joshua Sedler
Browse files

Issue #3075256: Error calling _captcha_insert_captcha_element

parent dff3f0e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ function _captcha_get_captcha_placement($form_id, $form) {
  }

  // Query the placement map.
  if (array_key_exists($form_id, $placement_map)) {
  if (array_key_exists($form_id, $placement_map) && $placement_map[$form_id] !== NULL) {
    $placement = $placement_map[$form_id];
  }
  // If no placement info is available in placement map:
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class CaptchaService {
   *
   * @param array $form
   *   the form to add the CAPTCHA element to.
   * @param array $placement
   * @param null|array $placement
   *   information where the CAPTCHA element should be inserted.
   *   $placement should be an associative array with fields:
   *     - 'path': path (array of path items) of the container in
@@ -95,7 +95,7 @@ class CaptchaService {
   * @param array $captcha_element
   *   the CAPTCHA element to insert.
   */
  public function insertCaptchaElement(array &$form, array $placement, array $captcha_element) {
  public function insertCaptchaElement(array &$form, null|array $placement, array $captcha_element) {
    // Get path, target and target weight or use defaults if not available.
    $target_key = $placement['key'] ?? NULL;
    $target_weight = $placement['weight'] ?? NULL;