Problem/Motivation

When a Translateable string is used in the webform directly, it breaks
Error: Cannot use object of type Drupal\Core\StringTranslation\TranslatableMarkup as array in webform_workflows_element_element_form_after_build() (line 256 of modules/contrib/webform_workflows_element/webform_workflows_element.module).
call_user_func_array() (Line: 1085)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 571)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 84)
Drupal\webform\Element\Webform::preRenderWebformElement()
call_user_func_array() (Line: 107)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 3580222-50.diff595 bytesmakertimswis
#3 diff3580222-1.diff682 bytesmakertimswis
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

makertimswis created an issue. See original summary.

makertimswis’s picture

StatusFileSize
new682 bytes

I think it can be as easy as an in_array check

mably’s picture

Hi @makertimswis, can you rebase your MR please? There are some conflicts.

makertimswis’s picture

StatusFileSize
new595 bytes

Rebased on 2.x branch

mably changed the visibility of the branch 3580222-cannot-use-object to hidden.

mably’s picture

Status: Active » Postponed (maintainer needs more info)

@makertimswis could you provide a reproducible scenario from a fresh Drupal instance please?

Eventually configure your failing test case in your MR's Tugboat instance.

makertimswis’s picture

Sorry never done this

our client has propiratery settings that i cannot share 1 to 1
is a webform config export with written flow how it breaks enough, otherwise have to learn Tugboat etc.

  • mably committed e882056b on 3580222-use-element-children
    fix: #3580222 Use Element::children() to iterate form elements
    
    Replace...

mably’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hi @makertimswis, can you give a try to MR 52 and see if it fixes your problem?

  • mably committed a2042174 on 2.x
    fix: #3580222 Cannot use object of type Drupal\Core\StringTranslation\...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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