2

I am adding an ief type field to my form with the following

    $form['inline_entity_form'] = [
        '#type' => 'inline_entity_form',
        '#op' => 'add',
        '#entity_type' => 'my_ent_type',
        '#bundle' => 'my_bundle',
    ];

I am sure this is something under my nose that i am missing but how do i force this to complex and set a cardinality for this instance?

Grateful for any pointers Mathew

1

Try changing the type to inline_entity_form_complex so that you have the following;

$form['inline_entity_form'] = [
    '#type' => 'inline_entity_form_complex',
    '#op' => 'add',
    '#entity_type' => 'my_ent_type',
    '#bundle' => 'my_bundle',
];

Got the pointer from the following answer. https://drupal.stackexchange.com/a/207582/9906

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.