Commit Graph

1812 Commits

Author SHA1 Message Date
Fabien Potencier
318576b3ac merged branch ericclemmons/2295-serializer-normalizable-traversable (PR #2578)
Commits
-------

7346896 Changed Serialized#supportsNormalization to PRIVATE
e851efc Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable"
d789f94 Serializer#normalize gives precedence to objects that support normalization
9e6ba9a Added protected Serializer#supportsNormalization

Discussion
----------

[Serializer] `normalize` should use supported normalizer before Traversable

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (discussion needed)
Symfony2 tests pass: yes
Fixes the following tickets: #2295

**Same as PR #2539, except rebased onto `2.0`**

Should I abstract out a `supportsDenormalization` function just for symmetry?
2011-11-08 07:46:27 +01:00
Eric Clemmons
e851efc8d6 Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable" 2011-11-07 19:25:58 -08:00
Fabien Potencier
dbba79651a [Yaml] fixed dumper for floats when the locale separator is not a dot 2011-11-04 08:47:39 +01:00
Fabien Potencier
165b08986b merged branch mrtorrent/use_parse_error_code_in_stubnumberformatter (PR #2521)
Commits
-------

89cd64a Set error code when number cannot be parsed. Fixes #2389

Discussion
----------

Set error code when number cannot be parsed in StubNumberFormatter

The stub implementation of NumberFormatter never sets an error code and instead always returns the "no-error" code. This causes unexpected results when a transformer gives it bad arguments, such as transforming the input value to boolean false and causing exceptions further down the line, as in #2389.

Instead, it should set an error code when appropriate and return it when requested so that a TransformationFailedException can be raised and the input value left unaltered.

There may be other instances where an error should be set. This covers the common use case of non-numeric input.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389
2011-11-02 14:36:52 +01:00
Fabien Potencier
2e90a813a4 merged branch mrtorrent/integer_transformer_cast_fix (PR #2520)
Commits
-------

c9d05d7 Let NumberFormatter handle integer type casting

Discussion
----------

Let NumberFormatter handle integer type casting

The integer to localised string transformer is currently casting everything it gets to an integer, even if it is not a number. This responsibility should be passed off to NumberFormatter.

Partially addresses #2389 by not mistakenly typecasting a boolean false into an integer 0

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

by mrtorrent at 2011/10/30 15:04:28 -0700

Apologies, forgot the template:

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389 (partial)
2011-11-02 14:36:23 +01:00
Fabien Potencier
af6f0d5548 [Form] removed some incomplete unit tests, added some new ones 2011-11-02 07:19:01 +01:00
Fabien Potencier
a554541cb4 [Process] removed an incomplete test that cannot be fixed 2011-11-02 06:58:56 +01:00
Eric Clemmons
eca414b8b2 Fixed incomplete EntityType tests
* testOverrideChoices
* testSetDataToUninitializedEntityWithNonRequired
2011-11-01 19:24:06 -07:00
Henrik Westphal
dec1858223 Fixed typo 2011-10-31 09:00:49 +01:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
89cd64a4a5 Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
c9d05d7236 Let NumberFormatter handle integer type casting
Partially addresses #2389 by not mistakenly typecasting a boolean false into
an integer 0
2011-10-30 21:17:28 +00:00
Fabien Potencier
68b7662400 fixed CS 2011-10-29 12:03:59 +02:00
Fabien Potencier
851eb73778 removed unused use statements 2011-10-29 11:56:30 +02:00
Jeremy Mikola
80f0b980ba [DependencyInjection] Fix DefinitionDecorator::getArgument() for replacements
While Definition::getArgument() could be used to fetch replaced values, it relied upon bad comparison logic (e.g. "index_1" > 1). Additionally, storing original arguments and replacements in the same array makes Definition::getArguments()'s bounds check unreliable. A single argument and its replacement would count twice, allowing getArgument(2) to pass the bounds check and result in an array index error.

With this new method, fetching of replacement arguments is more straightforward and bounds checking functions as it should.
2011-10-27 18:03:51 -04:00
Jeremy Mikola
4bbb685557 [DependencyInjection] Test Definition and DefinitionDecorator exceptions 2011-10-27 17:59:47 -04:00
Fabien Potencier
6c538dfb22 merged branch beberlei/ProcessPipesWindows (PR #2483)
Commits
-------

fee217f Update tests/Symfony/Tests/Component/Process/ProcessTest.php
d58e682 GH-2287 - Skip Process:processTest on Windows due to PHP bug #60120

Discussion
----------

[Process] Test with pipes hang on windows

Rebased onto 2.0
2011-10-26 23:08:26 +02:00
Benjamin Eberlei
fee217f56f Update tests/Symfony/Tests/Component/Process/ProcessTest.php 2011-10-26 20:18:39 +02:00
Benjamin Eberlei
d58e68269a GH-2287 - Skip Process:processTest on Windows due to PHP bug #60120 2011-10-26 20:18:39 +02:00
Fabien Potencier
5404a46c45 [HttpFoundation] marked some tests as skipped when intl is not available 2011-10-26 14:28:56 +02:00
Fabien Potencier
408414c252 [Form] marked some tests as skipped when intl is not available 2011-10-26 14:23:39 +02:00
Fabien Potencier
bc330d4487 merged branch lsmith77/fix_q_handling (PR #2365)
Commits
-------

d3f137b cosmetic tweak
2877883 anything in front of ;q= is part of the mime type, anything after may be ignored

Discussion
----------

[HttpFoundation] fix splitHttpAcceptHeader() parsing of parameters

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

anything in front of ;q= is part of the mime type, anything after may be ignored

see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

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

by lsmith77 at 2011/10/09 04:00:12 -0700

i must admit .. i am not 100% that my implemention is correct either .. but i am sure the current one isn't.

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

by lsmith77 at 2011/10/09 07:57:33 -0700

@fabpot: I am also not sure if getFormat() should optionally not support matching parameters, aka anything before ``;q=..``
2011-10-25 17:26:31 +02:00
Vadim Tyukov
808088a3ca added the ability to use dot and single quotes in the keys and values 2011-10-24 12:45:36 +03:00
Fabien Potencier
2b0af5e93b [HttpKernel] fixed profile parent/children for deep-nested requests 2011-10-17 02:32:06 +02:00
Fabien Potencier
2aa1e4d351 merged branch stloyd/tests-fix (PR #2401)
Commits
-------

205f524 [Tests] Skip MimeTypeTest if running as root
d3e9104 [Tests] Skip Routing annotation tests when Doctrine is not available.

Discussion
----------

[Tests] Fix tests when some vendor is not available.
2011-10-16 09:19:00 +02:00
Tobias Schultze
c73643675f fixed language in test 2011-10-16 07:53:44 +03:00
Joseph Bielawski
205f524758 [Tests] Skip MimeTypeTest if running as root 2011-10-15 13:45:35 +02:00
Joseph Bielawski
d3e9104b52 [Tests] Skip Routing annotation tests when Doctrine is not available. 2011-10-15 13:06:22 +02:00
Joseph Bielawski
d9d9c6b57a [Tests] Skip Monolog test if it's not available. 2011-10-15 13:00:48 +02:00
Benjamin Eberlei
9d8046e407 [Doctrine] GH-1635 - UniqueValidator now works with associations 2011-10-15 09:20:06 +02:00
Chris Smith
d8dfca21f2 [BrowserKit] Added additional unit tests for capital letters in cookies 2011-10-14 20:31:31 +01:00
Chris Smith
00cbd39813 [BrowserKit] Fixed cookie expiry discard when attribute contains capitals 2011-10-14 20:23:34 +01:00
Lukas Kahwe Smith
28778834c7 anything in front of ;q= is part of the mime type, anything after may be ignored
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
2011-10-09 12:58:45 +02:00
stealth35
ae0685a314 [Translation] Loader should only load local files 2011-10-07 18:30:56 +02:00
Fabien Potencier
f22566ca19 merged branch stloyd/ScalarTransformer (PR #2341)
Commits
-------

95049ef [Form] Added type check to `ScalarToChoiceTransformer`

Discussion
----------

[2.0][Form] Added type check to ScalarToChoiceTransformer

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:06:24 +02:00
Fabien Potencier
4cdf6ac9f4 merged branch stloyd/FormUtil (PR #2340)
Commits
-------

18a83c6 [Form] Simplified a bit `FormUtil` and extended test coverage

Discussion
----------

[2.0][Form] Simplified a bit `FormUtil` and extended test coverage

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:05:47 +02:00
stloyd
18a83c67f4 [Form] Simplified a bit FormUtil and extended test coverage 2011-10-07 12:04:26 +02:00
stloyd
95049ef902 [Form] Added type check to ScalarToChoiceTransformer 2011-10-07 12:01:07 +02:00
Joseph Bielawski
d7c9644d29 [Validator] Extend and fix DateValidator & TimeValidator tests 2011-10-07 10:47:59 +02:00
Katsuhiro OGAWA
828b18f467 [Form] Fixed lacking attributes in DateTimeType 2011-10-05 17:57:43 +09:00
Fabien Potencier
92d19063a8 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 08:43:04 +02:00
Fabien Potencier
5c8a2fb48d [Routing] fixed route overriden mechanism when using embedded collections (closes #2139) 2011-09-30 12:01:46 +02:00
Danny Berger
e70c884f49 [Bridge/Monolog] Fix WebProcessor to accept a Request object. 2011-09-30 01:58:45 -04:00
Fabien Potencier
d429594afb removed separator of choice widget when the separator is null 2011-09-29 10:14:34 +02:00
Fabien Potencier
6eeca8e36d merged branch stealth35/fix_2142 (PR #2290)
Commits
-------

b12ce94 [HttpFoundation] fix #2142 PathInfo parsing/checking

Discussion
----------

[HttpFoundation] fix #2142 PathInfo parsing/checking

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 15:02:56 +02:00
stealth35
b12ce94c38 [HttpFoundation] fix #2142 PathInfo parsing/checking
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 13:18:44 +02:00
Fabien Potencier
b4028350d2 [HttpFoundation] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:50 +02:00
Fabien Potencier
128468193f [BrowserKit] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:26 +02:00
Josef Cech
85ed5c67dc [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Fabien Potencier
49c585ebd2 Revert "merged branch stealth35/ini_bool (PR #2235)"
This reverts commit 363057b181, reversing
changes made to 545cd4cd63.
2011-09-25 11:33:22 +02:00
Fabien Potencier
fa13469bba Revert "[DependencyInjection] fixed array support for the ini loader"
This reverts commit e0ace8eaee.
2011-09-25 11:33:07 +02:00
Fabien Potencier
27fc06785b Revert "[DepedencyInjection] fixed unit tests"
This reverts commit b8e5a155e4.
2011-09-25 11:33:00 +02:00
Fabien Potencier
d830253876 [Routing] fixed unit tests broken by previous merge 2011-09-23 20:56:18 +02:00
Alberto Pirovano
ae3aded83f Added PCRE_DOTALL modifier to RouteCompiler to allow urlencoded linefeed in route parameters. 2011-09-23 16:53:06 +02:00
Fabien Potencier
b8e5a155e4 [DepedencyInjection] fixed unit tests 2011-09-23 11:59:37 +02:00
Fabien Potencier
e0ace8eaee [DependencyInjection] fixed array support for the ini loader 2011-09-23 11:45:30 +02:00
stealth35
11c441289a [DependencyInjection] fix 2219 IniFileLoader accept Boolean 2011-09-21 22:14:12 +02:00
Matthieu Bontemps
e3f6b4fc0d [Translation] Add a failing test when translating a non existent string with a fallback 2011-09-21 19:43:20 +02:00
stealth35
cf736ccde3 [DomCrawler] Add test for ChoiceFormField without value 2011-09-20 18:30:35 +02:00
stealth35
43b55efd04 [Locale] Fix #2179 StubIntlDateFormatter support yy format
Fix #2179 Year limit is 2031 like IntlDateFormatter
2011-09-16 13:12:22 +02:00
Fabien Potencier
c50a3a194d [Translation] fixed transchoice when used with a fallback 2011-09-14 22:31:09 +02:00
Fabien Potencier
c985ffaa99 [Translation] fixed message selector when the message is empty (closes #2144) 2011-09-14 22:04:39 +02:00
Fabien Potencier
55eaf4e0f5 merged branch danielholmes/master (PR #2031)
Commits
-------

777f876 [HttpFoundation] Added test that exposes error in session saving

Discussion
----------

[HttpFoundation] Added test that exposes error in session saving

Noticed this commit in the recent release:

https://github.com/symfony/symfony/commit/34a1b53

And noticed that the save in __destruct won't be fired if a manual save has been called. The testSavedOnDestructAfterManualSave test I've added fails on 2.0.1 but it passes with 2.0.0. An example:

$session->set('foo', 'value');
$session->__destruct(); // eventually called during shutdown, triggers a save
// During next request, $session->get('foo') returns 'value'

$session->set('foo', 'value');
$session->save();
$session->set('foo', 'newvalue');
$session->__destruct(); // eventually called during shutdown, however WON'T trigger save
// During next request, $session->get('foo') returns 'value'

In my eyes the save on destruction should still happen whether a save has been called manually or not - it's more predictable. But i can see arguments for the opposite as well.

If consensus is that this is a bug, I'm happy to provide a fix but wanted to get feedback on the 2 options:

 * Save optimisation can be reverted
 * Can make the save optimisation more intelligent so a write to storage is only done if something has changed. The best way to do this would be to close down the api and mark the session as invalid when an attribute is set for example, however all properties are currently protected and would need to be private, so it might break some people's extensions of session

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

by stof at 2011/09/04 02:13:52 -0700

@fabpot what about it ?
2011-09-14 20:55:06 +02:00
Fabien Potencier
73c8d2ba74 [Form] fixed error bubbling for Date and Time types when rendering as multiple choices (closes #2062) 2011-09-14 08:30:47 +02:00
H. Westphal
3e2f1a4b13 Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
Fabien Potencier
6677dabda5 merged branch jmikola/entity-validator (PR #2076)
Commits
-------

d19f1d7 [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results

Discussion
----------

[Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results

An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.

Note: the DoctrineMongoDBBundle's unique validator checks identifier values if the object strict-equality check is false. This may be a worthwhile improvement, as it would prevent reporting a validation error for an enttiy which is going to overwrite its conflicting counter-part in the database.

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

by jmikola at 2011/09/01 14:23:27 -0700

This is the Doctrine bridge equivalent for my fix to DoctrineMongoDBBundle: https://github.com/symfony/DoctrineMongoDBBundle/pull/42

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

by fabpot at 2011/09/02 00:13:52 -0700

As this is a bug fix, can you base your PR on the symfony/2.0 branch? Thanks.
2011-09-02 09:43:19 +02:00
Fabien Potencier
adb7291b67 Merge branch 'EvanK-patch-1' into 2.0
* EvanK-patch-1:
  Per the [documentation][1], the `NotBlank` constraint should be using the `empty` language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
2011-09-02 09:39:11 +02:00
Evan Kaufman
639513a67a Per the [documentation][1], the NotBlank constraint should be using the empty language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
[1]: http://symfony.com/doc/2.0/reference/constraints/NotBlank.html
2011-09-02 09:37:48 +02:00
Jeremy Mikola
d19f1d7621 [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results
An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.
2011-09-01 17:20:30 -04:00
Fabien Potencier
bddcb4cc11 fixed a unit test 2011-09-01 11:05:39 +02:00
Fabien Potencier
946ccb6bd2 [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Daniel Holmes
777f876b90 [HttpFoundation] Added test that exposes error in session saving 2011-08-26 20:00:57 +10:00
Fabien Potencier
8f50592f31 [HttpFoundation] changed \LogicException to \InvalidArgumentException 2011-08-26 08:45:12 +02:00
Fabien Potencier
1c7694ff30 [HttpFoundation] added a missing exception 2011-08-25 10:38:08 +02:00
Fabien Potencier
a79f22544e [HttpKernel] added a test for uploading a file via an array instead of an UploadedFile instance 2011-08-25 10:07:28 +02:00
Jeremy Mikola
39fabab013 [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Fabien Potencier
3380f2a039 [DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM) 2011-08-23 11:21:48 +02:00
Fabien Potencier
277d75b7ce [Security] added a unit test for previous merge 2011-08-23 08:52:50 +02:00
Fabien Potencier
0b531932a0 merged branch stloyd/issue_1986 (PR #2000)
Commits
-------

c29fa9d [Form] Fix for treatment zero as empty data. Closes #1986

Discussion
----------

[Form] Fix for treatment zero as empty data. Closes #1986

For more info please read #1986.
2011-08-23 08:44:09 +02:00
Fabien Potencier
2b1bb2c357 [Form] added missing DelegatingValidator registration in the Form Extension class (used when using the Form component outside a Symfony2 project where the validation.xml is used instead) 2011-08-22 22:35:46 +02:00
stloyd
933c5aa771 [Tests] Added missing test for NumberType 2011-08-22 15:23:00 +02:00
stloyd
c29fa9d64e [Form] Fix for treatment zero as empty data. Closes #1986 2011-08-22 15:19:31 +02:00
Fabien Potencier
b66eb4db57 merged branch stloyd/form_datetime_transformer (PR #1851)
Commits
-------

d880db2 [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes #1755
df74f49 Patched src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php to throw an exception when an invalid date is passed for transformation (e.g. 31st February)

Discussion
----------

[Form] Fix for "DateTimeToArrayTransformer" with invalid dates

Hey,

this is test covered fix from @mdavis1982 (closes #1755)

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

by stloyd at 2011/08/16 01:31:32 -0700

@fabpot Can we have this fix merged ?
2011-08-19 14:26:00 +02:00
Fabien Potencier
95719e78ad merged branch schmittjoh/requestMethodOverrideFix (PR #1980)
Commits
-------

a1d9fed updated tests
b6ee1a6 fixes a bug when overriding method via the X-HTTP-METHOD-OVERRIDE header

Discussion
----------

Request method override fix
2011-08-19 14:13:57 +02:00
Fabien Potencier
46bbfff336 merged branch lsmith77/create_from_globals_tests (PR #1983)
Commits
-------

8c9ccf6 added more tests for Request::createFromGlobals()

Discussion
----------

added more tests for Request::createFromGlobals()
2011-08-18 19:44:05 +02:00
Lukas Kahwe Smith
8c9ccf6bc2 added more tests for Request::createFromGlobals() 2011-08-18 19:10:51 +02:00
Johannes Schmitt
a1d9fed988 updated tests 2011-08-18 12:19:27 +02:00
Victor Berchet
1518a81ea7 [HttpKernel] Simplify test code 2011-08-18 09:32:26 +02:00
Fabien Potencier
0b5d87d484 [HttpFoundation] fixed a unit tests 2011-08-14 10:56:48 +02:00
Alexey Popkov
81fb8e16e7 [DomCrawler] fix finding charset in addContent 2011-08-10 13:41:07 +04:00
Fabien Potencier
9fd6b3c021 merged branch stloyd/console_fixtures (PR #1915)
Commits
-------

9f66263 [Console] Fix fixtures from failing tests

Discussion
----------

[Console] Fix fixtures from failing tests
2011-08-08 23:21:52 +02:00
Fabien Potencier
be031f54a1 [HttpKernel] fixed ControllerResolver when the controller is a class name with an __invoke() method 2011-08-08 23:20:03 +02:00
stloyd
9f662634fe [Console] Fix fixtures from failing tests 2011-08-07 10:00:06 +02:00
stloyd
d880db2791 [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes #1755 2011-07-28 12:16:58 +02:00
Fabien Potencier
8700cd6154 fixed CS 2011-07-27 08:27:46 +02:00
Fabien Potencier
422522bcf8 merged branch aboks/mimetype_test (PR #1775)
Commits
-------

1283c47 [HttpFoundation] Fixed incorrect test; MimeTypeGuesser should be (and is) able to detect a path that is not a file also without the 'fileinfo' extension

Discussion
----------

[HttpFoundation] Fixed incorrect test when 'fileinfo' extension is not enabled

This test failed on my box with `fileinfo` disabled. The `FileNotFoundException` is thrown also when the `fileinfo`-extension is not enabled, so it should be expected.
2011-07-27 08:24:12 +02:00
Fabien Potencier
de9f8ab47e added a unit test for previous merge 2011-07-27 08:00:56 +02:00
Fabien Potencier
c6308a5daf merged branch stof/trans_locale (PR #1808)
Commits
-------

85c0087 [TwigBridge] Made the locale configurable for the trans and transchoice tags
3ea31a0 [TwigBridge] Made the locale configurable for the trans and transchoice filters

Discussion
----------

Trans locale

This allows setting the locale when translating in a Twig template. This was already allowed in the Translator and in the PHP templates
2011-07-27 07:44:42 +02:00
Fabien Potencier
853935fbab [HttpFoundation] made PHP_AUTH_PW optional 2011-07-26 09:32:45 +02:00
Fabien Potencier
acd9d09ada [HttpKernerl] fixed some unit tests 2011-07-26 09:28:27 +02:00
Fabien Potencier
91a41020a8 merged branch sasezaki/BrowserKit_useragent (PR #1789)
Commits
-------

266e60e Don't tell a lie to every WebServers

Discussion
----------

Please don't tell a lie to every WebServers

Fake Useragent name should be only in test case .
2011-07-26 09:21:10 +02:00
Christophe Coevoet
85c0087825 [TwigBridge] Made the locale configurable for the trans and transchoice tags 2011-07-26 01:27:09 +02:00
Christophe Coevoet
3ea31a0263 [TwigBridge] Made the locale configurable for the trans and transchoice filters 2011-07-26 01:25:25 +02:00
Johannes Schmitt
0b3ff39704 fix supported cookie date formats 2011-07-24 21:28:31 +02:00
sasezaki
266e60e7a2 Don't tell a lie to every WebServers 2011-07-24 14:01:26 +09:00
Arnout Boks
0635548800 [Process] Fixed tests on Windows by using escapeshellarg to escape argument 2011-07-23 18:13:57 +02:00
Fabien Potencier
d236fc3662 merged branch aboks/icu_version (PR #1776)
Commits
-------

86aeb04 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed

Discussion
----------

[Form] Skip tests that are incompatible with the installed ICU (intl) library

Two tests for the `DateTimeToLocalizedStringTransformer` depend on a datetime-format that has only been added in version 3.8 of the ICU library (used by `intl`), see http://bugs.icu-project.org/trac/changeset/21815#file60. Some PHP-versions still ship with ICU 3.6 however.

This PR skips these tests when an incompatible version of the ICU library is detected. Unfortunately I had to copy-paste some code from `Symfony\Tests\Component\Locale\TestCase`, but I don't see any other way without creating a strange dependency between the tests for the Form and Locale components.

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

by Abhoryo at 2011/07/22 16:42:40 -0700

PHP 5.3.5 = ICU 3.6
PHP 5.3.6 = ICU 3.8
PHP 5.3.7rc4 = ICU 4.6

Since the RC3 of Symfony, config/check script recommends ICU 4.0+

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

by aboks at 2011/07/23 00:33:12 -0700

I noticed, but since it's not a hard requirement (and difficult for some people to install ICU 4.0+ at the moment) this PR would at least prevent false positives when people unable to upgrade run the test suite.
2011-07-23 16:15:26 +02:00
Fabien Potencier
9d3700427a merged branch aboks/console_test_decoration (PR #1774)
Commits
-------

04d0b6c [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value

Discussion
----------

[Console] Fixed tests that rely on undecorated Application/Command-output

Some tests compare the output of an `Application`/`Command` run to a fixed string. The output is decorated however (at least) when run on a Windows box with Ansicon installed.
This PR fixes these failing tests by forcing the `Application`/`Command`-output to be undecorated.
2011-07-23 16:13:19 +02:00
Arnout Boks
1283c47f98 [HttpFoundation] Fixed incorrect test; MimeTypeGuesser should be (and is) able to detect a path that is not a file also without the 'fileinfo' extension 2011-07-22 22:19:09 +02:00
Arnout Boks
86aeb042a1 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed 2011-07-22 22:16:48 +02:00
Fabien Potencier
18894762ee merged branch ericclemmons/fix-router-generator-empty-query-string (PR #1773)
Commits
-------

03c7cfe UrlGenerator no longer appends '?' if query string is empty

Discussion
----------

UrlGenerator no longer appends '?' if query string is empty

If you generate a URL using null parameters (`array('foo' => null, 'bar' => null')`), `http_build_query` returns an empty string, resulting in a trailing `?` at the end of the generated URL.

This fixes that so that, if there are `$extra` params & `http_build_query` is empty, the URL is no longer appended.

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

by fabpot at 2011/07/22 10:15:26 -0700

Can you add unit tests?

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

by ericclemmons at 2011/07/22 10:52:21 -0700

Yes sir, will do.

-Eric Clemmons
 Sent from my iPad Nano

On Jul 22, 2011, at 12:15 PM, fabpot<reply@reply.github.com> wrote:

> Can you add unit tests?
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1773#issuecomment-1633515

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

by ericclemmons at 2011/07/22 11:55:30 -0700

**Added passing test.**

Currently `master` fails test:

```
1) Symfony\Tests\Component\Routing\Generator\UrlGeneratorTest::testUrlWithNullExtraParameters
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/app.php/testing
+http://localhost/app.php/testing?

//tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php:114
```
2011-07-22 22:00:27 +02:00
Arnout Boks
04d0b6c821 [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value 2011-07-22 21:06:35 +02:00
Eric Clemmons
03c7cfed5e UrlGenerator no longer appends '?' if query string is empty 2011-07-22 11:53:54 -07:00
Fabien Potencier
e9d82506f7 merged branch marcw/revert-1758 (PR #1769)
Commits
-------

d43d621 [Form] Reverted PR #1758.

Discussion
----------

[Form] Reverted PR #1758.

Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 17:43:42 +02:00
marc.weistroff
d43d621829 [Form] Reverted PR #1758.
Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 16:42:50 +02:00
Fabien Potencier
aab0bf7e2c merged branch schmittjoh/httpUtilFixes (PR #1739)
Commits
-------

eae6a77 fixed wrong case
d0a175b fixes #1659
f300ede fixes several bugs
a4f05ac added some tests

Discussion
----------

Http util fixes

Fixes several bugs in the http utils.

Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise.

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

by fabpot at 2011/07/19 22:37:26 -0700

Tests do not pass for me:

    There were 2 errors:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    --

    There were 4 failures:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/en/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/de/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:27 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

    4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:28 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

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

by schmittjoh at 2011/07/19 23:47:29 -0700

I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu).

My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests.

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

by fabpot at 2011/07/20 00:28:41 -0700

That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response:

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>

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

by schmittjoh at 2011/07/20 00:31:34 -0700

That's weird, did you make sure that the temporary directory does not exist?

``rm -Rf /tmp/StandardFormLogin/``

On Wed, Jul 20, 2011 at 9:28 AM, fabpot <
reply@reply.github.com>wrote:

> That does not make any difference for me. For instance, in
> `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request
> to `'/'.$locale.'/login'` returns the following Response:
>
>    <html>
>        <head>
>            <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
>            <meta http-equiv="refresh" content="1;url=
> http://localhost/login" />
>        </head>
>        <body>
>            Redirecting to <a href="http://localhost/login">
> http://localhost/login</a>.
>        </body>
>    </html>
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1739#issuecomment-1613504
>

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

by fabpot at 2011/07/20 00:33:40 -0700

Yes, I've just checked and the directory does not exist.

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

by schmittjoh at 2011/07/20 00:39:55 -0700

Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
2011-07-22 14:45:54 +02:00
Fabien Potencier
c6115cee7f [BrowserKit] changed Cookie::fromString() to not take the secure setting into account if the URL is not present or is not HTTPS 2011-07-22 13:29:57 +02:00
marc.weistroff
257f86cb20 [Form] Collection's prototype is not not a child anymore. 2011-07-22 11:03:06 +02:00
marc.weistroff
2b4cc9bd06 [Form] Changed collection prototype rendering.
Based on PR 1500. It is now rendered inside an attribute of collection
tag.
2011-07-22 11:01:55 +02:00
marc.weistroff
2e024f87a3 [Form] CollectionType now checks for data_class parameter instead of only class. 2011-07-21 19:50:40 +02:00
marc.weistroff
0327beb0b9 [Form] Added ObjectFactoryListener. Fixes #1746. 2011-07-21 15:02:52 +02:00
Fabien Potencier
e42a2dede1 [Validator] fixed unit tests when intl is not installed 2011-07-20 14:45:35 +02:00
Fabien Potencier
e5fa78af31 [Form] fixed unit tests when intl is not installed 2011-07-20 14:36:55 +02:00
Fabien Potencier
9e7cb0a020 [Routing] fixed default value for Routes as they can be anything if they don't need to be used as default values for placeholders 2011-07-19 19:18:29 +02:00
Johannes Schmitt
f300edebe4 fixes several bugs 2011-07-19 16:21:58 +02:00
Fabien Potencier
d6cbbdd26c merged branch meckhardt/create-request-with-empty-path (PR #1736)
Commits
-------

95011ce [HttpFoundation] Fixed creation of requests without a path.

Discussion
----------

[HttpFoundation] Fixed creation of requests without a path.

Providing urls with no path led to php warning that the index 'path' is
not set. This patch initializes 'path' if no path is set.
2011-07-19 11:52:50 +02:00
Martin Eckhardt
95011ce4b7 [HttpFoundation] Fixed creation of requests without a path.
Providing urls with no path led to php warning that the index 'path' is
not set. This patch initializes 'path' if no path is set.
2011-07-19 10:54:21 +02:00
Fabien Potencier
a1d8c70890 [Routing] fixed a bug when a default value is an integer
A default value is always a string in the context of routing.
2011-07-17 17:30:35 +02:00
Deni
0f328d228b [Validator] Fixed using the strict option in the choice validator. 2011-07-16 21:16:21 +04:00
Fabien Potencier
d9048658d9 merged branch schmittjoh/lazyParameterBag (PR #1712)
Commits
-------

d37ff15 removed unused code
2d3051f tabs -> spaces
2c224ce improves the exception message, and removes unnecessary constraint to only allow strings inside strings
d0b056c fixes a bug where getParameterBag() always returns null

Discussion
----------

Fixes a bug in PHPDumper, and in parameter resolving
2011-07-16 18:30:54 +02:00
Fabien Potencier
52543e7a32 merged branch schmittjoh/cookieFix (PR #1702)
Commits
-------

eb85cc5 fixes a bug where the cookie was wrongly considered expired

Discussion
----------

fixes a bug where the cookie was wrongly considered expired

On a related note, what do you think about adding some more functional tests here? Not only phpunit, but I would also suggest to add behat tests since there are a lot of things which are not picked up by the in process request emulation, but only by a real client.

@fabpot, @everzet, what do you think?
2011-07-16 18:24:26 +02:00
Fabien Potencier
8e1f420e12 merged branch schmittjoh/sessionRename (PR #1705)
Commits
-------

5e80c68 fixes a naming inconsistency
8cfca15 added change to upgrade file
4123ec4 updated some missing references

Discussion
----------

Fix inconsistent naming

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

by jalliot at 2011/07/15 08:15:01 -0700

I think you forgot one commit (the one effectively changing Session and that you reverted in the main repo)

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

by schmittjoh at 2011/07/15 09:07:17 -0700

You're right, fixed now.
2011-07-16 18:23:21 +02:00
Johannes Schmitt
2c224ce42b improves the exception message, and removes unnecessary constraint to only allow strings inside strings 2011-07-16 16:10:11 +02:00
Fabien Potencier
5182a0c2c4 [Form] removed a constraint in PropertyPath as the path can definitely be an empty string for errors attached on the main form (when using a constraint defined with the 'validation_constraint' option) 2011-07-16 00:34:50 +02:00
Fabien Potencier
c04512086e [Validator] fixed error message property path when a collection error occurs 2011-07-16 00:29:54 +02:00
Johannes Schmitt
4123ec4a1f updated some missing references 2011-07-15 18:03:17 +02:00
Johannes Schmitt
eb85cc550b fixes a bug where the cookie was wrongly considered expired 2011-07-15 11:07:35 +02:00
Fabien Potencier
43543bb85d merged branch francisbesset/httpfoundation_requestmatcher (PR #1690)
Commits
-------

71cfb56 Thrown a \RuntimeException in RequestMatcher::checkIp6() if PHP is compiled with the option "disable-ipv6"

Discussion
----------

[HttpFoundation] Problem with RequestMatcher if PHP is compiled with the option "disable-ipv6"

Thrown a \RuntimeException in RequestMatcher::checkIp6() if PHP is compiled with the option "disable-ipv6".
2011-07-15 10:35:42 +02:00
Francis Besset
71cfb56917 Thrown a \RuntimeException in RequestMatcher::checkIp6() if PHP is compiled with the option "disable-ipv6" 2011-07-15 10:28:46 +02:00
Fabien Potencier
2a0178c2b5 merged branch jmikola/yaml-numeric-strings (PR #1688)
Commits
-------

05cc24c [Yaml] Wrap numeric strings in quotes when dumping

Discussion
----------

[Yaml] Wrap numeric strings in quotes when dumping

This addresses an obscure case where a hash string (actually a commit-ish, "686e444") was dumped to YAML as an unquoted string value. It was later parsed from YAML as an exponential numeric and changed to ".Inf".

This commit should not change the existing behavior when dumping non-string numerics. It also doesn't appear to disturb any of the other test cases. I realize it's a huge edge case, so I'm open to discussion.

The alternative to this fix was an ugly `preg_replace()` to apply quoting around the commit-ish after dumping. I would look forward to removing that :)
2011-07-15 08:39:27 +02:00
Jeremy Mikola
5803a8ed05 [Yaml] Do not skip consistency checks in InlineTest::testDump()
These conditionals were excluding 12.30e+02 from being checked. Removing the conditionals does not break any tests.
2011-07-13 17:23:21 -04:00
Jeremy Mikola
05cc24ce5b [Yaml] Wrap numeric strings in quotes when dumping
This addresses an obscure case where a hash string (actually a commit-ish, "686e444") was dumped to YAML as an unquoted string value. It was later parsed from YAML as an exponential numeric and changed to ".Inf".
2011-07-13 16:58:57 -04:00
Johannes Schmitt
b7c4806a5a [Security] fixes #1329 2011-07-13 18:10:58 +02:00
Fabien Potencier
4004b4411e merged branch francisbesset/httpfoundation_responseheaderbag (PR #1640)
Commits
-------

64e9263 Updated UPDATE.md
7cf891a Renamed variable returned and used self in place of static for constants
f91f4dd Added the possibility to set cookies with the same name for different domains and paths for Symfony\Component\HttpFoundation\ResponseHeaderBag
f08eeb4 Moved managing cookies of HeaderBag in ResponseHeaderBag

Discussion
----------

[HttpFoundation] Cookies management in ResponseHeaderBag

Fixed cookies management in `Symfony\Component\HttpFoundation\HeaderBag` and `Symfony\Component\HttpFoundation\ResponseHeaderBag`
2011-07-13 16:37:40 +02:00
Fabien Potencier
88d915d175 [Validator] fixed Min and Max validator when the input value is not a number (now return an error message instead of an exception which does not make sense in this context) 2011-07-12 17:40:02 +02:00
Francis Besset
f91f4dda13 Added the possibility to set cookies with the same name for different domains and paths for Symfony\Component\HttpFoundation\ResponseHeaderBag
ResponseHeaderBag::hasCookie() and ResponseHeaderBag::getCookie() were removed
2011-07-11 23:03:26 +02:00
Fabien Potencier
e8ea852179 added missing test 2011-07-11 18:38:59 +02:00
Fabien Potencier
9a6aafa83f added missing required classes on form label 2011-07-11 18:37:09 +02:00
Fabien Potencier
e718a51b59 [DependencyInjection] fixed un-detected circular references involving aliases 2011-07-11 18:25:40 +02:00
Fabien Potencier
4e605aa761 merged branch Seldaek/form_tpl (PR #1519)
Commits
-------

52fdd53 [Bridge/Twig] Add required class to labels that match required fields

Discussion
----------

[Bridge/Twig] Add required class to labels that match required fields

I have used this to simply style labels that are required with a red star behind them using this CSS:

``` css
label.required::after {
	content: " *";
	color: #c00;
}
```

The problem is that you can't use `input[required] + label::after` as a selector since the label is typically rendered before the input. There is no way to check for an element that is *followed by* another, only elements *following*.

Of course this CSS in particular won't work except in the latest browsers, but you could still use the `label.required` selector to add a background image and so on. I think this is a very common use case and therefore I think it'd benefit the core framework.

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

by fabpot at 2011/07/05 01:27:49 -0700

Can you also update the PHP templates?

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

by schmittjoh at 2011/07/05 01:43:33 -0700

How about namespacing these css classes, like for example "sf-form-required"?

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

by stloyd at 2011/07/05 01:50:58 -0700

I would prefer an @schmittjoh naming, or even adding ability to setup it thought options.

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

by fabpot at 2011/07/05 01:54:36 -0700

Please, do not add more options. Prefix with `sf` is actually a good idea but people will argue that this is not a good idea because it gives too much information about the technology used to create the website (that's one of the things that came up pretty often in symfony1).

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

by schmittjoh at 2011/07/05 02:00:11 -0700

An option is not such a good idea imo since you likely want to have a uniform naming strategy across your entire site. How about adding a new service CssNamingStrategy?

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

by stloyd at 2011/07/05 02:01:19 -0700

Then this can be some simpler one not giving such informations i.e.: `form-label-required`, `label-required`, `framework-form-required`, `form-required` or whatever else ;-)

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

by fabpot at 2011/07/05 02:16:41 -0700

It cannot be configurable as it would potentially break bundles that come with stylesheets.

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

by stloyd at 2011/07/05 02:21:10 -0700

IMO if we decide to add this one, we could add same to `inputs/selects/etc` with `required` option.

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

by schmittjoh at 2011/07/05 02:21:59 -0700

I think it can, consider an interface like this:

```php
interface CssNamingStrategyInterface
{
    function getCssName($class);
}
```

This will give people a lot of flexibility, and it also does allow them to exclude classes which for example are provided by third-party bundles.

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

by Seldaek at 2011/07/05 02:47:54 -0700

Wow guys, if this turns into a full blown class generator solution, I'm happy to close the PR.

"required" is not a name that's commonly used for main page elements, it's typically associated with forms, and therefore I don't see the need to make it unnecessary longer/namespaced. Similarly I don't see the need to add it to the input/select/.., because they already have an attribute, which you can very easily select as: `input[required]` in CSS. That works everywhere except IE6, but we can't build for the future on very old browsers. If you really want support for IE6, you can override the templates imo. But core should be looking forward, as it already is with HTML5, form markup, etc.

As for calling it form-label-required or label-required, again, I don't see the benefit, you can use `label.required` if you want to avoid conflicts with non-label elements having a required class, or a safer `form .required`. There are plenty of options in CSS itself, let's not make this overly complex.

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

by schmittjoh at 2011/07/05 02:52:17 -0700

see
http://code.google.com/intl/de-DE/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors

On Tue, Jul 5, 2011 at 11:47 AM, Seldaek <
reply@reply.github.com>wrote:

> Wow guys, if this turns into a full blown class generator solution, I'm
> happy to close the PR.
>
> "required" is not a name that's commonly used for main page elements, it's
> typically associated with forms, and therefore I don't see the need to make
> it unnecessary longer/namespaced. Similarly I don't see the need to add it
> to the input/select/.., because they already have an attribute, which you
> can very easily select as: `input[required]` in CSS. That works everywhere
> except IE6, but we can't build for the future on very old browsers. If you
> really want support for IE6, you can override the templates imo. But core
> should be looking forward, as it already is with HTML5, form markup, etc.
>
> As for calling it form-label-required or label-required, again, I don't see
> the benefit, you can use `label.required` if you want to avoid conflicts
> with non-label elements having a required class, or a safer `form
> .required`. There are plenty of options in CSS itself, let's not make this
> overly complex.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1519#issuecomment-1502560
>

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

by Seldaek at 2011/07/05 03:11:50 -0700

Really? Come on, we're talking about forms, it's not like you have billions of form/input tags per page that have to be parsed by the browser when you select that. Also you don't have to select the elements, if you want true performance just use no stylesheet, your users will thank you.

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

by schmittjoh at 2011/07/05 03:30:40 -0700

Your CSS selectors not only affect the performance of form elements, but of all elements that have a "required" class. Likewise, the same applies if we decide to add more classes.

Why close the door for people who care about performance? We can easily avoid this by making the css class more specific as suggested earlier. The idea with the renaming strategy is one step further and allows people to "obfuscate" which tool was used to generate the form, or do additional optimizations like shortening the css name.

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

by lenar at 2011/07/05 03:34:34 -0700

@Seldaek: Just for remark I've seen matrix forms spanning multiple screenfuls horizontally and vertically
containing tens of thousands inputs. Not pretty, but they do exist. Basically "poor" man's/company's excel
emulation or something.

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

by Seldaek at 2011/07/05 04:19:13 -0700

@schmittjoh, @lenar: We're catering to the most common use case, for which this will be more than fast enough. Small/medium scale websites don't have to optimize on CSS rules parsing, they usually have much bigger issues to deal with. If you really care about it, overriding the block to remove the class is just as easy as it was to for me to add it, but IMO this is the edge case.

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

by schmittjoh at 2011/07/05 05:37:19 -0700

IMO Symfony should follow best practices by encouraging to use class selectors, and not tag selectors for the reasons explained on the page I linked.

Anyway, I think everybody made his points. Time for @fabpot to make a decision :)
2011-07-11 11:32:26 +02:00
Fabien Potencier
0e4d057984 moved some RFC-tweaking logic in Response to a public method to make it reusable 2011-07-11 11:22:12 +02:00
Fabien Potencier
1a576552f8 [HttpFoundation] fixed unit test for previous merge 2011-07-11 11:02:30 +02:00
Fabien Potencier
2f51bc3ef3 [Security] fixed tests 2011-07-11 08:28:02 +02:00
Benjamin Eberlei
08b4219347 [DoctrineBridge] Issue #1376 - Unique Validator does not work with null values 2011-07-10 11:06:21 +02:00
Fabien Potencier
4a7b7597d8 merged branch marcw/validator-choice (PR #1577)
Commits
-------

df57e0f [Validator] Added strict option to ChoiceConstraint.

Discussion
----------

[Validator] Added strict option to ChoiceConstraint.

By default, ChoiceValidator was ensuring strict type when checking if value is present in choices. This behavior is a problem when you want to validate against integer values. As all data you will receive from a request will be typed as a string, you won't be able to validate these numeric values.
This patch solves this.

In order for being nice to developers, I've set "strict" to false by default.
2011-07-09 09:19:08 +02:00
marc.weistroff
df57e0fe9a [Validator] Added strict option to ChoiceConstraint. 2011-07-07 15:11:36 +02:00
Fabien Potencier
9b3c2ca3d3 merged branch vicb/uploaded-file/max-size (PR #1574)
Commits
-------

6786e81 [HttpFoundation] code factorization in UploadedFile

Discussion
----------

[HttpFoundation] code factorization in UploadedFile

As both #1542 and #1544 have been merged.
2011-07-07 11:06:29 +02:00
Fabien Potencier
76a5816d60 [HttpKernel] fixed recursion when flattenning an exception stack trace 2011-07-07 10:59:18 +02:00
Victor Berchet
6786e81f61 [HttpFoundation] code factorization in UploadedFile 2011-07-07 10:47:10 +02:00
Fabien Potencier
befb234e5c merged branch stof/form_type (PR #1552)
Commits
-------

ef022c0 Removed the magical guessing of the type name to avoid WTF issues

Discussion
----------

Removed the magical guessing of the type name to avoid WTF issues

As discussed on IRC, this removes the magical method to avoid breaking the user-land code by reusing the same name than another type which overrides it. This makes the user aware that a type should have a name as they now have to implement the method themselves.

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

by jalliot at 2011/07/06 05:35:30 -0700

Doc and generator should be modified as well if it's merged.
2011-07-06 15:36:48 +02:00
Fabien Potencier
990fb4638a merged branch everzet/console-help-printing-fix (PR #1553)
Commits
-------

fa20b51 [Console] refactored definition printer
e49d61f [Console] fixed console help printing expectations

Discussion
----------

[Console] definitions printing fix

Before this change, console component printed definitions as:

``` bash
Arguments:
 features        Feature(s) to run. Could be a dir (features/),
a feature (*.feature) or a scenario at specific line
(*.feature:10).

Options:
 --config (-c) Specify external configuration file to load. behat.yml or config/behat.yml will be used by default.
 --profile (-p) Specify configuration profile to use. Define profiles in config file (--config).
 --init Create features directory structure.

 --format (-f) How to format features. pretty is default. Available formats are
- pretty
- progress
- html
- junit
 --out Write formatter output to a file/directory instead of STDOUT (output_path).
 --colors Force Behat to use ANSI color in the output.
 --no-colors Do not use ANSI color in the output.
 --no-time Hide time in output.
 --lang Print formatter output in particular language.
 --no-paths Do not print the definition path with the steps.
 --no-snippets Do not print snippets for undefined steps.
 --no-multiline No multiline arguments in output.
 --expand Expand Scenario Outline Tables in output.

 --story-syntax Print *.feature example in specified language (--lang).
 --definitions Print available step definitions in specified language (--lang).

 --name Only execute the feature elements (features or scenarios) which match part of the given name or regex.
```

As you might see, indentation is totally broken (also notice how it prints multiline descriptions in argument and --format option).

This PR makes output looks like this:

``` bash
Arguments:
 features        Feature(s) to run. Could be a dir (features/),
                 a feature (*.feature) or a scenario at specific line
                 (*.feature:10).

Options:
 --config (-c)   Specify external configuration file to load. behat.yml or config/behat.yml will be used by default.
 --profile (-p)  Specify configuration profile to use. Define profiles in config file (--config).
 --init          Create features directory structure.

 --format (-f)   How to format features. pretty is default. Available formats are
                 - pretty
                 - progress
                 - html
                 - junit
 --out           Write formatter output to a file/directory instead of STDOUT (output_path).
 --colors        Force Behat to use ANSI color in the output.
 --no-colors     Do not use ANSI color in the output.
 --no-time       Hide time in output.
 --lang          Print formatter output in particular language.
 --no-paths      Do not print the definition path with the steps.
 --no-snippets   Do not print snippets for undefined steps.
 --no-multiline  No multiline arguments in output.
 --expand        Expand Scenario Outline Tables in output.

 --story-syntax  Print *.feature example in specified language (--lang).
 --definitions   Print available step definitions in specified language (--lang).

 --name          Only execute the feature elements (features or scenarios) which match part of the given name or regex.
```
2011-07-06 15:14:36 +02:00
Fabien Potencier
3228d50f1e [Form] fixed test 2011-07-06 15:06:44 +02:00
Fabien Potencier
9140395b4f merged branch kertz/date_pattern (PR #694)
Commits
-------

d08a688 [Form] Fixed CS
954bdb5 [Form] Updated DateTimeType to accept a custom date pattern for the DateType child  * Added a test also about this change
e7e744f [Form] Synced changes in this branch with current Symfony master branch
436cb95 [Form] Changed to a CreateException when the 'format' option is invalid  * Updated DateTypeTest also
0045ffe [Form] Added tests to check that the date format option is validated correctly  * Format option must be either a IntlDateFormatter constants (FULL, LONG, MEDIUM, SHORT) or a string
a815232 [Form] The IntlDateFormatter pattern can now be passed via the format option  * Also changed the default value of the calendar paramter to \IntlDateFormatter:GREGORIAN    in DateTimeToLocalizedStringTransformer which is the same as the default value in    StubIntlDateFormatter
58f869a [Form] Synced custom pattern tests with master branch
c20edde [Form] Added some tests  * Tests to check if the pattern option is handled correctly by DateType  * Tests to check if the pattern parameter is handled correctly by DateTimeToLocalizedStringTransformer
52a1e1d moved date_pattern to IntlDateFormatter
dd104bc added code to use custom date_pattern

Discussion
----------

[Form] Added code to use custom date_pattern

Current DateType doesn't make use of the `date_pattern` option. Added code to use the custom `date_pattern` if provided.

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

by maoueh at 2011/05/02 21:52:37 -0700

You should also pass the pattern option to the DateTimeToLocalizedStringTransformer so the pattern is taken in consideration when converting from and to localized string. You can check the commit I did on my repository (maoueh/symfony@01ae75dd84) which do the same as yours for the DateType but also includes the modification needed by the DateTimeToLocalizedStringTransformer class.

Not sure if there is more work needed to fully support the pattern option. Moreover, I did not run the tests to check if everything pass correctly. It would also be a good idea to add some tests to check that the date_pattern is working as expected.

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

by dot-i-fy at 2011/05/02 22:02:14 -0700

There is also a problem with the regex, but this is not regarding the pattern option. If you set the 'format' option to 0, it returns the IntlDateFormatter::FULL but it does not pass the regex because there is first EEEE in the standard pattern so it comes on the fallback pattern year month day

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

by kertz at 2011/05/02 23:36:05 -0700

Thanks for your suggestions @maoueh and @dot-i-fy, I will check them.
I found the `date_pattern` doesn't work when using text widget. I will try to fix this.

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

by dot-i-fy at 2011/05/03 00:02:45 -0700

Here the regex I use now and working with IntlDateFormatter::FULL

https://gist.github.com/952929

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

by maoueh at 2011/05/03 07:13:01 -0700

@kertz: It is working for me using the text widget on my development machine. Don't know what is the problem on our side but it is working correctly for me. I'm willing to help track this problem if you want. Just let me know.

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

by dot-i-fy at 2011/05/03 07:57:34 -0700

@kertz : It is also working for me, we just have to pay attention about the format to be used in the text input regarding IntlDateFormatter.

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

by kertz at 2011/05/03 11:15:23 -0700

Ah well I guess I screwed up the whole commit log!

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

by dot-i-fy at 2011/05/03 11:19:08 -0700

wow !

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

by maoueh at 2011/05/03 11:23:51 -0700

Hell yeah! :) You should do a rebase the next time instead of merging Symfony master branch into yours:
 `git rebase symfony/master date_pattern` and when you need to push your changes to your repository, do `git push -f origin date_pattern`. This way, it will be easier for the core team to handle the merge process.

Since @dot-i-fy opened a pull request for fixing the same issue as here, maybe it would be a good idea to close this PR?

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

by kertz at 2011/05/03 11:33:34 -0700

Well, it's done. I just pushed it a little earlier that I should have! Well I didn't know that @dot-i-fy opened a PR, where is it? This patch currently works for me.

Regarding the change in regex, well I think it should also have a ChoiceList for week days, otherwise it's not useful. Probably that alone can be a separate PR.

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

by maoueh at 2011/05/03 11:46:09 -0700

Yep it is much better now :) I think it would be a good idea to remove this commit from your PR kertz/symfony@e47cfb6d49.

The other PR is [PR751](https://github.com/symfony/symfony/pull/751). Maybe @dot-i-fy could change is PR so it will only be about the regex? In both cases, you should coordinate with each other I think.

Thanks for merging the changes I made to the DateTimeToLocalizedStringTransformer class.

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

by dot-i-fy at 2011/05/03 12:00:06 -0700

Yeah, I will modify my commit to take only the regex in account.

Would someone work with me on the TimeType ? The pattern is also not working there but it looks like a little bit more complicated!

Thanks

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

by kertz at 2011/05/03 12:02:18 -0700

Thanks for the changes in DateTimeToLocalizedStringTransformer.

Is it really necessary to remove the initial commit?

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

by dot-i-fy at 2011/05/03 12:06:41 -0700

What does it mean CS ?

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

by maoueh at 2011/05/03 12:08:44 -0700

@dot-i-fy: It means Code Style, the comma is not placed correctly

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

by kertz at 2011/05/03 12:11:24 -0700

`Coding Standards` seems right :) http://symfony.com/doc/2.0/contributing/code/standards.html

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

by dot-i-fy at 2011/05/03 12:11:27 -0700

ah ok, thx

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

by maoueh at 2011/05/03 12:12:10 -0700

@kertz: I don't think it is strictly necessary to remove this commit. But I think it is a good idea since you kinda reverted it with some changes in a later commit. The core team might ask you to remove it. So leave it for now, and change it if they ask you to do so.

Hehe right, Coding Standards looks way better :)

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

by maoueh at 2011/05/03 12:30:00 -0700

@dot-i-fy: I will check later in the evening what can be done about the pattern in the TimeType class. I'm also planning on adding some tests about this PR. If I do so, I will send a PR to your repository @kertz so you will be able to add the tests to this PR.

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

by dot-i-fy at 2011/05/03 13:04:35 -0700

I had some problems with PHPUnit, seems to be ok now. Another problem, damned, APC is showing in my browser when in app_dev.php, not in prod. Any idea ? Can't get html output in dev env.

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

by dot-i-fy at 2011/05/04 00:43:46 -0700

@RapotOR : Are you talking about the dateType method in IntlDateFormatter ? If no can you make a snippet in gist with an example ?

If yes ...The option "format" already allows an IntlDateFormatter input, you can either set a \IntlDateFormatter::MEDIUM for example or an integer representing the dateType to use (0 -> full, 1 -> long, ... ).

The problem we are reveling here is the pattern based off the dateFormat option :

the $formatter look for Locale -> then for format option and based off these options he generate a pattern who can be different regarding the Locale. For example, for me I have my locale in php set to fr_BE, so my dates are always d-m-Y formatted but if I want to modify that it is momently not possible.

Grtz

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

by RapotOR at 2011/05/04 00:57:03 -0700

@dot-i-fy : my thought was more about having a full control of IntlDateFormatter from outside; instead of defining every variables. It is more like a DI way... especially if you have more than one DateType field!

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

by dot-i-fy at 2011/05/04 01:11:21 -0700

Oh so, it may be indeed a nice way to follow. Don't hesitate to submit your code suggestions.
But I think that if we go deeper in the core modifications, it is maybe a solution to take the $formatter out of the dateType class and put it in a own class and call it from the dateType class ???@}#

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

by maoueh at 2011/05/05 08:22:40 -0700

@mweimerskirch: Maybe it would be better to rename your option html_pattern? Since the pattern is not strictly associated to a date type, it would be a better name in my opinion if it was named html_pattern or html5_pattern?

I think it would lead to more misunderstandings if we had a date_pattern and a pattern option. In both cases, I agree totally that one or the other needs a renaming. Moreover, if we change the pattern option in the date type, I think the format option should be changed also to date_format.

What do you think?

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

by kertz at 2011/05/05 23:58:21 -0700

@mweimerskirch

I too think when we specify `pattern` in `DateType` everyone expects it to be the date pattern. So maybe renaming the HTML5 pattern to `html_pattern` would be more appropriate?

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

by bschussek at 2011/05/18 12:20:56 -0700

Looks good. Why don't we reuse the "format" option for this? If "format" is not one of the predefined constants, we could treat it as a custom date format.

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

by maoueh at 2011/05/18 12:28:22 -0700

@bschussek: I think it is a good idea indeed. When I first played with forms, I thought that the purpose of the format option was exactly for this but I soon realized it wasn't. I'm +1 for this.

@kertz: Let me know if you don't have time to do this switch, I will gladly submit the changes to you own repo if we agree to use "format" option instead of the "pattern" one.

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

by dot-i-fy at 2011/05/18 12:33:33 -0700

``format`` and ``pattern`` options are related to the IntlDateFormatter, I also agree with you but we have to keep in mind that we will loose the symmetry with the IntlDateFormatter class.

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

by bschussek at 2011/05/18 13:39:07 -0700

I think we can safely add this level of abstraction.

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

by kertz at 2011/05/18 20:29:11 -0700

@maoueh Would be great if you can make the changes :)

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

by dot-i-fy at 2011/05/19 09:09:41 -0700

@bschussek : I saw you removed pattern option, what are further intentions ?

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

by maoueh at 2011/05/19 09:42:40 -0700

@kertz: I will do the changes needed tomorrow as I have some spare times. You will need to sync your branch with current master or I will need to send another PR since @bschussek removed the pattern option which will cause bad conflicts with this implementation.

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

by kertz at 2011/05/20 06:45:22 -0700

@maoueh I've merged the changes.

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

by kertz at 2011/05/20 07:11:36 -0700

@maoueh I just removed a couple of commits from the log. Seems like the tests you committed are now missing from the PR. Can you please send the tests once again? Sorry about that.

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

by maoueh at 2011/05/20 09:03:52 -0700

@kertz: I will resend them along with the code modifications to use `format` instead of `pattern`.

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

by maoueh at 2011/05/20 19:11:28 -0700

I did the changes to make it possible to pass a custom pattern via the format option. I sent a PR on @kertz repository [here](https://github.com/kertz/symfony/pull/2) that will be merge eventually in this PR.

I have two small questions about it. First, since format option can now be a string, the allowed values for the option `format` have been removed from the array returned by `getAllowedOptionValues`. The check is done instead in the method `buildForm` directly. The 'format' option can be either one of the `IntlDateFormatter` constants (FULL, LONG, MEDIUM, or SHORT) or a string. If those conditions are not respected, a `FormException` is thrown. Is this correct?

When the `format` option is a custom pattern, the IntlDateFormatter needs a valid format even if it will not be used. So I retrieved the default format option by using the `getDefaultOptions` method. Is this correct or should I specify the default value directly:

this (specify directly):

    $format = \IntlDateFormatter::MEDIUM;

instead of (use predefined defaults):

    $defaultOptions = $this->getDefaultOptions($options);
    $format = $defaultOptions['format'];

Also added more tests to verify that the format option is validated correctly and updated previous ones.

Regards,
Matt

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

by kertz at 2011/05/20 20:38:32 -0700

Merged the changes. I have not tested this yet... Thanks @maoueh :)

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

by dot-i-fy at 2011/05/20 22:48:47 -0700

nice job @maoueh

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

by mprizmic at 2011/06/16 14:06:47 -0700

what do you think about
$pattern = $form->getAttribute('pattern');
instead of
$pattern = $form->getAttribute('formatter')->getPattern();
in line 96 of
symfony/component/form/extension/core/type/datetype.php

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

by maoueh at 2011/06/16 14:40:37 -0700

It is simpler to use the pattern of the formatter directly I think. The reason is that if the option to change the format is null, the default pattern of the formatter will be available and will be the right pattern to use. If the option is set, we modify the formatter before hand so getting the pattern from it will return the custom pattern we have set in the options.

So in both cases, no conditional is required to verify if it is set or not when retrieving the pattern from the formatter. Moreover, I think the pattern must be set as an attribute of the form for your suggestion to work correctly which is not the case right now.

Regards,
Matt

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

by stloyd at 2011/07/05 13:41:36 -0700

@fabpot What we do with that ? I have tried to rebase it with master, but my (Windows) git always gets insane and this ends up with unfixable error. This feature __should__ be in Symfony2 before final. Should I start work on it from "none" ?

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

by fabpot at 2011/07/06 05:44:26 -0700

@stloyd: I need to review the patch first.
2011-07-06 15:04:55 +02:00
everzet
e49d61f86e [Console] fixed console help printing expectations 2011-07-06 15:43:58 +03:00
Fabien Potencier
d49eaa6a41 merged branch vicb/kernel/client-ini-max-size (PR #1544)
Commits
-------

3df5ec3 [HttpKernel] Add support for 'upload_max_filesize' ini directive in the Client

Discussion
----------

[HttpKernel] Add support for 'upload_max_filesize' ini directive

[HttpKernel] Add support for 'upload_max_filesize' ini directive in the Client

__This PR depends on #1542__

This PR prevent the SW Client from uploading files larger than the limit set in php.ini to closer mimic a real browser usage.

If both PR eventually gets merge `static protected function getMaxUploadFilesize()` should probably be factorized to the UploadedFile class.

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

by stloyd at 2011/07/05 13:35:06 -0700

+1 for both, I just have found similar "wtf" issues with "empty" `upload_max_filesize`.

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

by oscarballadares at 2011/07/05 15:13:23 -0700

I have opened an issue related to UPLOAD_ERR_INI_SIZE. There was no way to handle this exception.
Can you confirm please?

 If this is the case I will close the issue I opened.

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

by vicb at 2011/07/05 23:04:08 -0700

@oscarballadares the PR you are looking for is most probably #1542 - which you should see in the message thread of your submitted issue.

The best would be for you to verify that PR #1542 fixes your issue and provide some feedback so that the issue can be close but only when the PR gets merged (if it fixes the issue).
2011-07-06 14:22:28 +02:00
Fabien Potencier
b9adab9796 merged branch vicb/form/ini-max-size (PR #1542)
Commits
-------

d58ba34 [Validator] Consider the ini directive 'upload_max_filesize' while validating an uploaded file (fixes GH-1441)

Discussion
----------

[Validator] FileValidator support for uploaded files

[Validator] Consider the ini directive 'upload_max_filesize' while validating an uploaded file (fixes GH-1441)

Added validator messages should get translated in all the available languages.
2011-07-06 14:22:15 +02:00
Christophe Coevoet
ef022c0c6c Removed the magical guessing of the type name to avoid WTF issues 2011-07-06 14:20:59 +02:00
Victor Berchet
3df5ec3de5 [HttpKernel] Add support for 'upload_max_filesize' ini directive in the Client 2011-07-05 22:01:06 +02:00
Victor Berchet
d58ba34246 [Validator] Consider the ini directive 'upload_max_filesize' while validating an uploaded file (fixes GH-1441) 2011-07-05 20:05:50 +02:00
Fabien Potencier
c814d4ce9c merged branch beberlei/ChoiceFix (PR #1531)
Commits
-------

03fee4f Fix permissions
431460f [Form] Remove choice or choice_list requirement as the following conditions already check enough and this condition prevents empty select forms (populated by ajax for example)

Discussion
----------

[Form] Choice fix

[Form] Remove choice or choice_list requirement as the following conditions already check enough and this condition prevents empty select forms (populated by ajax for example)

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

by stloyd at 2011/07/05 06:26:36 -0700

You should revert permission changes.

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

by fabpot at 2011/07/05 06:28:14 -0700

Why not replacing `if (!$options['choices'] && !$options['choice_list']) {` by `if (!isset($options['choices']) && !isset($options['choice_list'])) { `?

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

by beberlei at 2011/07/05 06:35:50 -0700

gnaa permission changes, i cant seem to configure my machine such that it does not do it, i have to do this on a per repository basis, very annoying.

@fabpot isset() is already guaranteed because these two options are in the defaults.

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

by beberlei at 2011/07/05 06:39:43 -0700

Fixed the permissions

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

by stof at 2011/07/05 06:48:37 -0700

@beberlei Can't you fix it in the global git config ?

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

by webda2l at 2011/07/05 09:48:58 -0700

I met the same problem this afternoon and vote for the isset solution. Better than nothing and work for me.
https://github.com/symfony/symfony/pull/1539

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

by stof at 2011/07/05 09:50:09 -0700

@webda2l why is a check that always return true better than nothing ? It adds overhead without adding any value in the code.
2011-07-05 20:04:38 +02:00
Fabien Potencier
932cd10477 made HTTP headers coming from proxies non-trusted by default 2011-07-05 19:49:36 +02:00
Benjamin Eberlei
03fee4f6cf Fix permissions 2011-07-05 15:39:05 +02:00
Benjamin Eberlei
431460f6ff [Form] Remove choice or choice_list requirement as the following conditions already check enough and this condition prevents empty select forms (populated by ajax for example) 2011-07-05 15:19:46 +02:00
Fabien Potencier
4f8a98033a [Security] removed a hack 2011-07-05 11:00:08 +02:00
Fabien Potencier
e293fb7abe fixed unit tests 2011-07-04 21:33:54 +02:00
Fabien Potencier
c9a9200115 merged branch stloyd/datetime_fixes (PR #1485)
Commits
-------

3917ed7 Revert "* DateType, DateTimeType, TimeType: - a bit changed readability"
c85b815 Fixed few issues with Date and Time:

Discussion
----------

[Form] Fixed few issues with Date and Time

Fixed few issues with Date and Time:

* TimeType:
  - seconds are no longer populated if "with_seconds" = false
  - "widget = text" is now properly rendered (closes #1480)
* DateTimeToStringTransformer:
  - fixed using not default "format" (probably fix #1183)
* DateType, DateTimeType, TimeType:
  - fixed "input = datetime" and test covered
2011-07-04 20:26:31 +02:00
Jordi Boggiano
52fdd53af8 [Bridge/Twig] Add required class to labels that match required fields 2011-07-04 20:04:44 +02:00
Fabien Potencier
cc03b73253 merged branch Herzult/testSecurity (PR #1447)
Commits
-------

164aea4 [Security] Add tests for the channel listener
d51cbc0 [Security] Remove useless attribute in basic authentication listener & test it
91e6dc9 [Security] Add tests for the anonymous authentication listener
3c2affb [Security] Update access listener constructor's prototype and add tests
81afd77 [Security] Add tests for the firewall map
aa6ae33 [Security] Remove useless attribute & var in firewall

Discussion
----------

Test security

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

by lsmith77 at 2011/06/29 13:41:07 -0700

@schmittjoh is probably the person to review this change ..
2011-07-04 12:47:32 +02:00
Fabien Potencier
beecac3adb [Form] simplified previous merge and fixed unit test 2011-07-04 12:13:46 +02:00
Benjamin Eberlei
9069d06732 Fix tests to run with Doctrine Common AnnotationRegistry 2011-07-03 16:44:01 +02:00
Fabien Potencier
4259530856 [Config] fixed a unit test 2011-07-01 10:15:26 +02:00
Fabien Potencier
2b60131275 merged branch Seldaek/router_esc (PR #1471)
Commits
-------

418d6a0 [Routing] Fix syntax error when dumping routes with single quotes in the requirements or pattern
2b5e22d [Routing] Fix ApacheDumper when a space appears in a default value
6c7f484 [Routing] Fix dumper so it doesn't print trailing whitespace
761724a [Routing] Adjust urlescaping rules, fixes #752

Discussion
----------

[Router] Bunch o' Fixes

The first commit changes the escaping rule to fix issues I had previously, and #752 as well, here's from the full commit message:

    Only + and % are now encoded in generated routes, since they are the only characters that, if not encoded, could cause problems/conflicts when decoded. Namely + turns into a space, and % followed by numbers could do funky things.

    The matcher decodes everything which works since nothing will have %NN without being escaped, and + are escaped as well.

Second commit is just a test fix for the first

Third and fourth are simply dumper escaping issues, nothing to argue about.

Note that all changes have had test cases added, and I spent a few hours torturing/testing all this stuff with both Apache and PHP dumpers, in many browsers, and with URLs as wonky as `/%01%02%03%04%05%06%07%08%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22$%25&%27%28%29*+,-./0123456789:;%3C=%3E@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B|%7D~/baz` which essentially represent the 1-255 char range minus ? and #.

The only issues I really encountered after all the patches were applied is that Apache refuses to match `%22` (= `"`) and `*` in a url. I guess it's just because they're not allowed chars in windows paths, but | and < > works fine though. Anyway this works with the PHP dumper, and it didn't work either without my patches so it's not like I broke it, I'm just saying for the record.
2011-07-01 10:09:44 +02:00
Fabien Potencier
1cf3bc4891 merged branch schmittjoh/annotationUpdate (PR #1483)
Commits
-------

1cc1027 added @Annotation to UniqueEntity
ee22c5d added a note to update file
efcb435 updated to doctrine changes

Discussion
----------

updated to doctrine changes

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

by excelwebzone at 2011/06/30 06:29:23 -0700

Should also be implemented to the Route class and to all SensioFrameworkExtraBundle annotation classes
2011-06-30 20:36:10 +02:00
stloyd
c85b815c7b Fixed few issues with Date and Time:
* TimeType:
  - seconds are no longer populated if "with_seconds" = false
  - "widget = text" is now properly rendered (closes #1480)
* DateTimeToStringTransformer:
  - fixed using not default "format" (probably fix #1183)
* DateType, DateTimeType, TimeType:
  - fixed "input = datetime" and test covered
  - a bit changed readability
2011-06-30 14:48:56 +02:00
Johannes Schmitt
efcb435268 updated to doctrine changes 2011-06-30 12:03:19 +02:00
Fabien Potencier
339ad861bb added missing translator calls in form templates 2011-06-29 19:26:59 +02:00
Adrian Rudnik
08bbb1938b UnitTest 2011-06-29 18:22:32 +02:00
Jordi Boggiano
418d6a0ead [Routing] Fix syntax error when dumping routes with single quotes in the requirements or pattern 2011-06-29 03:40:17 +02:00
Jordi Boggiano
2b5e22d961 [Routing] Fix ApacheDumper when a space appears in a default value 2011-06-29 03:40:13 +02:00
Jordi Boggiano
761724ae57 [Routing] Adjust urlescaping rules, fixes #752
Only + and % are now encoded in generated routes, since they are the only characters that, if not encoded, could cause problems/conflicts when decoded. Namely + turns into a space, and % followed by numbers could do funky things.

The matcher decodes everything which works since nothing will have %NN without being escaped, and + are escaped as well.
2011-06-29 03:39:54 +02:00
Fabien Potencier
c3bb214e94 [DependencyInjection] removed injection for protected and private properties 2011-06-27 08:28:54 +02:00
Antoine Hérault
164aea448a [Security] Add tests for the channel listener 2011-06-26 11:56:08 +02:00
Antoine Hérault
d51cbc09b4 [Security] Remove useless attribute in basic authentication listener & test it 2011-06-26 11:29:43 +02:00
Antoine Hérault
91e6dc9fef [Security] Add tests for the anonymous authentication listener 2011-06-26 11:28:17 +02:00
Antoine Hérault
3c2affb7e7 [Security] Update access listener constructor's prototype and add tests 2011-06-26 10:28:10 +02:00
Antoine Hérault
81afd77ed9 [Security] Add tests for the firewall map 2011-06-26 00:26:42 +02:00
Fabien Potencier
fc1808643f merged branch Herzult/fixHttpBasicAuthEntryPoint (PR #1439)
Commits
-------

e43cd20 [Security] Fix http retry authentication entry point
cb3ad8b [Security] Fix http form authentication entry point
1dfb637 [Security] Fix http digest authentication entry point
920a209 [Security] Fix http basic authentication entry point

Discussion
----------

[Security] Fix the http authentication entry points and test them
2011-06-25 19:41:21 +02:00
Antoine Hérault
aa6ae33765 [Security] Remove useless attribute & var in firewall 2011-06-25 19:04:35 +02:00
Antoine Hérault
e43cd206b0 [Security] Fix http retry authentication entry point 2011-06-25 18:19:13 +02:00
Antoine Hérault
cb3ad8bb79 [Security] Fix http form authentication entry point 2011-06-25 18:01:08 +02:00
Antoine Hérault
1dfb637858 [Security] Fix http digest authentication entry point 2011-06-25 17:43:23 +02:00