Commit Graph

6079 Commits

Author SHA1 Message Date
Fabien Potencier
a7c1ff8558 merged branch ajessu/time_validator (PR #1254)
# Commits

ca52a04 [Validator] Allow DateTime objects as valid Times

# Discussion

## [Validator] Allow DateTime objects as valid Times

Also added tests for `DateTime` objects as valid on `Date` and `Time` constraints.

I didn't include the test for the `DateTime` constraint, as it's already included in this PR:

https://github.com/symfony/symfony/pull/1085

---------------------------------------------------------------------------

## fabpot @ 2011/06/09 09:07:21 -0700

I don't think it makes sense to use a \DateTime instance to represent a Time.

---------------------------------------------------------------------------

## ajessu @ 2011/06/09 09:33:20 -0700

If I have an entity with a doctrine type `Time`:

    Time (DateTime instance where only H:i:s get persisted)

```php
<?php
    /**
     * @ORM\Column(type="time")
     * @Assert\Time()
     */
    protected $startTime;
```

and I create a form out of this Entity, a `DateTime` object is passed when the form is submitted.

This generates an `UnexpectedTypeException`.

I just made this change to match the `Date` validator with the doctrine type `Date`, which also shares this behavior:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/DateValidator.php#L28

    Date (DateTime instance where only Y-m-d get persisted)
2011-06-14 12:08:41 +02:00
Victor Berchet
38b3b7474f [HttpKernel] Fix and test previous commit 2011-06-14 11:54:55 +02:00
Victor Berchet
ac0c00c6e8 [HttpFoundation] Make File extends \SplFileInfo 2011-06-14 10:47:04 +02:00
Victor Berchet
87ca9f3a52 [Validation] some tweaks and phpDoc 2011-06-14 09:40:26 +02:00
Victor Berchet
4e3e2768fb [Form] Make the prototype view child of the collection view 2011-06-14 09:33:19 +02:00
Fabien Potencier
2ce3cfad18 [Form] made it possible to translate the empty value of Choice fields 2011-06-14 08:33:48 +02:00
Fabien Potencier
c364008a3b [Form] allowed an empty value to be displayed for choices even when required is true
Rules are as follows:

* If multiple is true, then the empty_value is ignored
* If not, and if the field is not required, the empty_value is set to the empty string by default and displayed
* If the field is required, and if the user explicitely set the empty_value, then it is displayed
2011-06-14 08:27:19 +02:00
Fabien Potencier
b29597a585 Merge remote branch 'stof/form_collection'
* stof/form_collection:
  [TwigBridge] fixed the check for the collection prototype in the form theme
2011-06-14 07:48:17 +02:00
Ryan Weaver
52cbbfe0d3 [HttpKernel] Adding small example of how the extension alias is auto-generated 2011-06-13 17:16:49 -05:00
Christophe Coevoet
df0039f701 [TwigBridge] fixed the check for the collection prototype in the form theme 2011-06-14 00:15:50 +02:00
Fabien Potencier
a12ea12fc1 fixed CS 2011-06-13 18:54:20 +02:00
Fabien Potencier
0b7a19e6fd [DoctrineBundle] removed old code 2011-06-13 18:38:56 +02:00
Fabien Potencier
d16a708cc8 [Form] simplified file type class
File uploads documentation is here:

https://github.com/symfony/symfony-docs/pull/400
2011-06-13 18:11:18 +02:00
Fabien Potencier
59f0602aef Merge remote branch 'kriswallsmith/assetic/fix-type-hint'
* kriswallsmith/assetic/fix-type-hint:
  [AsseticBundle] fixed an incorrect type hint
2011-06-13 17:37:08 +02:00
Kris Wallsmith
dc2da52790 [AsseticBundle] fixed an incorrect type hint 2011-06-13 08:27:11 -07:00
Kris Wallsmith
16e3aa3dc3 [AsseticBundle] added FileResource test 2011-06-13 08:17:05 -07:00
Kris Wallsmith
1890dab212 [AsseticBundle] added custom coalescing logic to work with logical template names 2011-06-13 08:17:05 -07:00
Fabien Potencier
33baf9d8ad [FrameworkBundle] partially reverted previous merge 2011-06-13 17:00:18 +02:00
Fabien Potencier
459678a0e9 Merge remote branch 'vicb/twig-templates'
* vicb/twig-templates:
  [FrameworkBundle] Fix previous commit
  [TwigBundle] Optimize the FilesystemLoader
2011-06-13 16:54:21 +02:00
Fabien Potencier
16e6cea240 [DoctrineBundle] fixed generation of the first entity in a bundle (closes #1271) 2011-06-13 16:29:04 +02:00
Fabien Potencier
196350b892 Merge remote branch 'djama/patch-1'
* djama/patch-1:
  call header() with replace=false, to provide the possibility of sending mutiple headers of the same type.
2011-06-13 12:19:40 +02:00
Fabien Potencier
9c1f999e21 [FrameworkBundle] fixed typo 2011-06-13 11:58:58 +02:00
Fabien Potencier
0c29a25d89 Merge remote branch 'kriswallsmith/form/collection-proto'
* kriswallsmith/form/collection-proto:
  added script[type="text/html"] collection prototype to form themes
  [Form] removed collection prototype from form tree
2011-06-13 11:51:18 +02:00
Fabien Potencier
973b323b12 Merge remote branch 'vicb/form-render-fix'
* vicb/form-render-fix:
  [Form][TwigBridge] Improve the cache layer by caching blocks instead of templates
  [Form][TwigBridge] Make the template cache more efficient
  [Form][TwigBridge] Fix rendering
2011-06-13 11:48:44 +02:00
Fabien Potencier
41b7190efc Revert "[Form] changed the way default type names are created to avoid collisions"
This reverts commit d044498cde.

The reason for reverting is that the name is actually used to customize
the template on a per field basis:

{% block _post_excerpt_widget %}
    ***{{ block('text_widget') }}***
{% endblock %}

Here, post is the name of the Type.
2011-06-13 11:47:21 +02:00
Fabien Potencier
5526757e13 Merge remote branch 'asm89/default_charset'
* asm89/default_charset:
  [HttpKernel] Added tests for non UTF-8 content types.
2011-06-13 11:24:02 +02:00
Fabien Potencier
0fc56346f7 Merge remote branch 'AurelC2G/fix-charset'
* AurelC2G/fix-charset:
  [HttpFoundation] Fixed indentation
  [HttpFoundation] Fixed charset always being set to UTF-8
2011-06-13 11:22:46 +02:00
Fabien Potencier
b72f980fac Merge remote branch 'brikou/phpdoc_formType'
* brikou/phpdoc_formType:
  [Form] added phpdoc (inherit) for types
2011-06-13 11:20:57 +02:00
Fabien Potencier
11761e48a5 Merge remote branch 'brikou/phpdoc_session'
* brikou/phpdoc_session:
  [Session] added phpdoc about flash messages
2011-06-13 11:20:35 +02:00
Fabien Potencier
dbac5324ee Merge remote branch 'pzwosta/php-scope-request'
* pzwosta/php-scope-request:
  [AsseticBundle] fixed ScopeWideningInjectionExc in prod evn using php templates
2011-06-13 11:15:48 +02:00
Fabien Potencier
0ec604cb1e Merge remote branch 'mschneid/master'
* mschneid/master:
  Fix array access
2011-06-13 11:12:46 +02:00
Fabien Potencier
f803086ac6 Merge remote branch 'pborreli/tests-typos'
* pborreli/tests-typos:
  [Tests] Fixed typos
2011-06-13 11:10:19 +02:00
Fabien Potencier
2ba7e4207c Merge remote branch 'craue/patch-4'
* craue/patch-4:
  typo
2011-06-13 11:09:38 +02:00
Kris Wallsmith
a3ed5e3f84 [AsseticBundle] changed file resource string value to logical template name 2011-06-12 19:12:22 -07:00
Lee McDermott
49dd558444 Couple more CS fixes 2011-06-13 02:40:21 +01:00
Michael Schneider
fdab1955f8 Fix array access
If you provide only one field as string you're not able to access the $constraint->fields as an array. Use $fields instead.
2011-06-12 23:48:17 +02:00
Pascal Borreli
f5eaa404c7 [Tests] Fixed typos 2011-06-12 20:52:53 +00:00
Christian Raue
99eb3a120d typo 2011-06-12 11:59:47 -07:00
Victor Berchet
dbea68effc [FrameworkBundle] Fix previous commit 2011-06-12 18:37:54 +02:00
Victor Berchet
acd2cf11d8 [TwigBundle] Optimize the FilesystemLoader 2011-06-12 14:49:18 +02:00
Victor Berchet
b19052f879 [Form][TwigBridge] Improve the cache layer by caching blocks instead of templates 2011-06-12 12:56:25 +02:00
Victor Berchet
9135f963db [Form][TwigBridge] Make the template cache more efficient 2011-06-12 12:15:48 +02:00
Victor Berchet
8677aa3dce [Form][TwigBridge] Fix rendering 2011-06-12 11:33:17 +02:00
Peter Zwosta
c0e120e072 [AsseticBundle] fixed ScopeWideningInjectionExc in prod evn using php templates
The definition "assetic.helper.static" references the service "templating.helper.assets" which belongs to a narrower scope. Generally, it is safer to either move "assetic.helper.static" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "templating.helper.assets" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.
2011-06-11 19:49:13 +02:00
Kris Wallsmith
5b0f1da074 [HttpKernel] made WebTestCase methods static 2011-06-11 08:50:27 -07:00
Lee McDermott
5a986bfc27 Add $keysCount & minor CS fix 2011-06-11 16:43:28 +01:00
Lee McDermott
91f4097a09 [Routing] Better nesting for RouteCollections in dumped URL matcher classes
With this change, a route prefixed with '/blogger' will be nested inside '/blog' (for example)
2011-06-11 16:11:55 +01:00
Fabien Potencier
f1e8c1bce5 fixed autoloader 2011-06-11 13:58:27 +02:00
Alexander
07d823caa8 [HttpKernel] Added tests for non UTF-8 content types.
Tests to check that #1281 is fixed and to prevent regression in the
future.
2011-06-11 13:57:43 +02:00
Brikou CARRE
66ae994528 [Form] added phpdoc (inherit) for types 2011-06-11 11:59:28 +02:00