Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:42:07+00:00 2026-06-02T13:42:07+00:00

When I visit my browser this is what i get: Fatal error: Declaration of

  • 0

When I visit my browser this is what i get:

Fatal error: Declaration of Ecs\CrmBundle\Form\Parts\DepartmentSelectionType::getDefaultOptions() must be compatible with Symfony\Component\Form\FormTypeInterface::getDefaultOptions() in C:\wamp\www\crm\src\Ecs\CrmBundle\Form\Parts\DepartmentSelectionType.php on line 41

And the file that it is referencing there is found below:

<?php

namespace Ecs\CrmBundle\Form\Parts;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;


class DepartmentSelectionType extends AbstractType {
    private $canSeeAll = false;

    public function __construct($canSeeAll = false)
    {
        $this->canSeeAll = $canSeeAll;
    }

    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('department', 'entity',
                array(
                    'class' => "EcsAgentManagerBundle:EmployeeDepartment",
                    'required' => false,
                    'multiple' => true,
                    'expanded' => true,
                    'label' => "Department"))
        ;
    }

    public function getDefaultOptions(array $options)
    {
        return array(
            'data_class' => 'Ecs\AgentManagerBundle\Entity\EmployeeDepartment',
        );
    }

    public function getName()
    {
        return 'ecs_crmbundle_departmentselectiontype';
    }
}

is the file that it is referencing… Any ideas on what the issue can be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:42:09+00:00Added an answer on June 2, 2026 at 1:42 pm

    I believe the FormTypeInterface has changed in Symfony 2.1.

    getDefaultOptions no longer takes an argument.

    From the UPGRADE-2.1 document:


    The methods getDefaultOptions() and getAllowedOptionValues() of form
    types no longer receive an option array.

    You can specify options that depend on other options using closures
    instead.

    Before:

    public function getDefaultOptions(array $options)
    {
        $defaultOptions = array();
    
        if ($options['multiple']) {
            $defaultOptions['empty_data'] = array();
        }
    
        return $defaultOptions;
    }
    

    After:

    public function getDefaultOptions()
    {
        return array(
            'empty_data' => function (Options $options, $previousValue) {
                return $options['multiple'] ? array() : $previousValue;
            }
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error when I visit myapp/feed in my browser: NoMethodError in Konkurrancers#feed
When i run my features i get this error: undefined method `visit' for #<Cucumber::Rails::World:0x81b17ac0>
Please visit http://domenadesign.com/istra-bike.com with Firefox browser! After a few clicks on the links page
Visit this website. https://zapier.com/ See this portion of the website. I wan that same
Please visit this link Click on first Image. Now is showing the Modal page
If you visit this page in Internet explorer, and choose a value from the
If you visit this site , you will see that there is an image
I'm trying to visit a page with cucumber, with: visit new_video_path but I get
When I visit a site I built some time ago in IE, I get
EDIT Solution: Visit your IP in the browser after you node server.js to kick-start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.