The fix in #2905907: Notice: Uninitialized string offset: 0 in Drupal\Core\Render\Element::property() (line 27 of /var/www/html/core/lib/Drupal/Core/Render/Element.php) was only applied to validateFormRecursive(). I am still getting that error, but now it is on the submit function which uses similar code to what was replaced in the validate function.

Error:

Notice: Uninitialized string offset: 0 in Drupal\Core\Render\Element::property() (line 27 of core/lib/Drupal/Core/Render/Element.php)

#0 core/includes/bootstrap.inc(584): _drupal_error_handler_real()
#1 core/lib/Drupal/Core/Render/Element.php(27): _drupal_error_handler()
#2 modules/contrib/webform/src/WebformSubmissionConditionsValidator.php(265): Drupal\Core\Render\Element::property('')
#3 modules/contrib/webform/src/WebformSubmissionConditionsValidator.php(245): Drupal\webform\WebformSubmissionConditionsValidator->submitFormRecursive(Array, Object(Drupal\webform\Entity\WebformSubmission), Array)

This is addressed by making the same change in #2905907: Notice: Uninitialized string offset: 0 in Drupal\Core\Render\Element::property() (line 27 of /var/www/html/core/lib/Drupal/Core/Render/Element.php) to submitFormRecursive()

if (Element::property($key) || !is_array($element)) {
  continue;
}

to

if (Element::child($key) || !is_array($element)) {
        continue;
      }

patch forthcoming -

Comments

jastraat created an issue. See original summary.

jastraat’s picture

Status: Active » Needs review
StatusFileSize
new684 bytes

Suggested patch attached

Status: Needs review » Needs work

The last submitted patch, 2: multipage_form_error-2999765-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jastraat’s picture

Quick mention that this error is with Drupal 8.6.1, so it may not exist in sites running Drupal 8.5.x

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new5.48 KB

We might want to try changing all instance to

(Element::property($key) || !is_array($element)

…to…

(!Element::child($key) || !is_array($element)

jrockowitz’s picture

Status: Needs review » Needs work

The next step is going to be moving all calls to (!Element::child($key) || !is_array($element)) to a new WebformElement::isElement method.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new11.21 KB

  • jrockowitz committed 1f84fd5 on 8.x-5.x
    Issue #2999765 by jrockowitz, jastraat: Notice: Uninitialized string...
jrockowitz’s picture

Status: Needs review » Fixed

@jastraat Thanks for the initial patch. I committed the final patch. Please download the latest dev release to review.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.