<?php

namespace Talk;

use Event\EventEntity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Form used to render and validate the speakers collection on a Talk form
 */
class TalkMediaFormType extends AbstractType
{
    /**
     * Returns the name of this form type.
     *
     * @return string
     */
    public function getName()
    {
        return 'talk_media';
    }

    /**
     * Adds fields with their types and validation constraints to this definition.
     *
     * @param FormBuilderInterface $builder
     * @param array                $options
     *
     * @return void
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('url', 'text', [
                'label' => false,
                'required' => false,
            ])
            ->add(
                'type',
                'choice',
                [
                    'choices' => [
                        'slides_link'  => 'Slides',
                        'video_link'   => 'Video',
                        'audio_link'   => 'Audio',
                        'code_link'    => 'Code',
                        'joindin_link' => 'JoindIn',
                    ],
                    'label' => false,
                ]
            )
        ;
    }
}

<?php

namespace Talk;

use Event\EventEntity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Form used to render and validate the speakers collection on a Talk form
 */
class TalkMediaFormType extends AbstractType
{
    /**
     * Returns the name of this form type.
     *
     * @return string
     */
    public function getName()
    {
        return 'talk_media';
    }

    /**
     * Adds fields with their types and validation constraints to this definition.
     *
     * @param FormBuilderInterface $builder
     * @param array                $options
     *
     * @return void
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add(
                'type',
                'choice',
                [
                    'choices' => [
                        'slides_link'  => 'Slides',
                        'video_link'   => 'Video',
                        'audio_link'   => 'Audio',
                        'code_link'    => 'Code',
                        'joindin_link' => 'JoindIn',
                    ],
                    'label' => false,
                ]
            )
            ->add('url', 'text', [
                'label'    => false,
                'required' => false,
            ])
        ;
    }
}

Align media form with displayed media link info
Align media form with displayed media link info

The issue was that if you have a media link and click ad media link
the form had a different order or type and uri.
