Skip to content

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
* 2.4:
  udpated LICENSE year
  update year on licenses
  rundown and typo fix
  [Process] Fix #9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  [Console] Fixed command name guessing if an alternative is an alias.
  Update UPGRADE-2.3.md to account for #9388
  [WebProfilerBundle] Fixed profiler toolbar icons for XHTML.
  [BrowserKit] Throw exception on invalid cookie expiration timestamp
  [Propel1Bridge][ModelChoiceList] add exception message for invalid classes
  • Loading branch information
fabpot committed Jan 7, 2014
2 parents ef12af9 + 7955999 commit 0af3ca3
Show file tree
Hide file tree
Showing 66 changed files with 178 additions and 70 deletions.
26 changes: 26 additions & 0 deletions UPGRADE-2.3.md
Expand Up @@ -170,6 +170,32 @@ Form
$form = $builder->getForm();
```

* Previously, when the "data" option of a field was set to `null` and the
containing form was mapped to an object, the field would receive the data
from the object as default value. This functionality was unintended and fixed
to use `null` as default value in Symfony 2.3.

In cases where you made use of the previous behavior, you should now remove
the "data" option altogether.

Before:

```
$builder->add('field', 'text', array(
'data' => $defaultData ?: null,
));
```

After:

```
$options = array();
if ($defaultData) {
$options['data'] = $defaultData;
}
$builder->add('field', 'text', $options);
```

PropertyAccess
--------------

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Doctrine/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Monolog/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Expand Up @@ -17,6 +17,8 @@

use Symfony\Component\Form\Exception\StringCastException;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;

/**
Expand Down Expand Up @@ -84,6 +86,13 @@ public function __construct($class, $labelPath = null, $choices = null, $queryOb
$this->class = $class;

$queryClass = $this->class.'Query';
if (!class_exists($queryClass)) {
if (empty($this->class)) {
throw new MissingOptionsException('The "class" parameter is empty, you should provide the model class');
}
throw new InvalidOptionsException(sprintf('The query class "%s" is not found, you should provide the FQCN of the model class', $queryClass));
}

$query = new $queryClass();

$this->query = $queryObject ?: $query;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Propel1/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Expand Up @@ -243,4 +243,20 @@ public function testDontAllowInvalidChoiceValues()
$this->assertEquals(array(), $choiceList->getValuesForChoices(array(new Item(2, 'Bar'))));
$this->assertEquals(array(), $choiceList->getChoicesForValues(array(2)));
}

/**
* @expectedException \Symfony\Component\OptionsResolver\Exception\MissingOptionsException
*/
public function testEmptyClass()
{
$choiceList = new ModelChoiceList('');
}

/**
* @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
*/
public function testInvalidClass()
{
$choiceList = new ModelChoiceList('Foo\Bar\DoesNotExistClass');
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/ProxyManager/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Swiftmailer/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Resources/meta/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/SecurityBundle/Resources/meta/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/Resources/meta/LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
@@ -1,4 +1,4 @@
Copyright (c) 2004-2013 Fabien Potencier
Copyright (c) 2004-2014 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 0af3ca3

Please sign in to comment.