8000 [form][2.8.1] new 'entry_options' not making it to underlying formtype · Issue #17443 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[form][2.8.1] new 'entry_options' not making it to underlying formtype #17443
Closed
@matthbull

Description

@matthbull

In trying to fix some 2.8 deprecation warnings and I've come across an issue where entry_options are not passing to the underlying formType. I'm not sure if this is me or its a bug, but I'll try to explain as clearly as I can.

using a CollectionType form field as follows:

Parent form

// ...
 $builder->add( 'teacher_scale_versions', CollectionType::class, array(
        'entry_type' => BudgetVersionTableType::class,
        'entry_options' => array(
            'school'       => $school,
            'data_class'   => 'SBS\BudgetBundle\Entity\BudgetTeacherScale',
            'version_type' => SBSBudgetBundle::REFERENCE_TEACHER_SCALES,
        ),
       // .......

child form

   // ....

  public function configureOptions( OptionsResolver $resolver) {
    $resolver->setRequired( array( 'version_type', 'school' ) );
  }

error:

The required options "school", "version_type" are missing.

Using xdebug to see whats being passed where, it seems that the entry_options are not making it through to the child BudgetVersionTableType::class which needs them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0