Commit Graph

5482 Commits

Author SHA1 Message Date
Fabien Potencier
053d2ec179 merged branch yethee/update_translations (PR #1661)
Commits
-------

ad2b224 [FrameworkBundle] Updated Russian translations.
95f7eed [FrameworkBundle] Fixed messages of the Choice constraint in all translations.

Discussion
----------

[FrameworkBundle] Fixes for all translations

Fixed the source messages of the choice contstraint for all translations, and re-sort messages.

And also updated Russian translations, added translations for all constraints.
2011-07-12 20:51:34 +02:00
Fabien Potencier
3825a842d7 [DoctrineBundle] fixed unit tests for previous merge 2011-07-12 20:16:16 +02:00
Deni
ad2b224637 [FrameworkBundle] Updated Russian translations. 2011-07-12 22:10:41 +04:00
Fabien Potencier
362aa330b0 merged branch geoffreytran/master (PR #1655)
Commits
-------

91cfb24 Made namespace for Doctrine cache unique to each environment

Discussion
----------

Made the cache namespace for the Doctrine cache extension unique to each environment

The current cache namespace for the Doctrine adapters is unique on an entity manager and the kernel root directory; however, it causes problems as settings for entity managers can differ between environments, so the addition of the environment into the namespace would address the issue.

        $namespace = 'sf2orm_'.$entityManager['name'].'_'.md5($container->getParameter('kernel.root_dir'));

Solves issues with the cache not being valid for the DBAL ACL provider using D2 as the cache and switching environments.

        An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or  empty in ../vendor/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404")
2011-07-12 20:08:56 +02:00
Fabien Potencier
121a407f05 merged branch stloyd/patch-2 (PR #1656)
Commits
-------

31317cc [Validator] Sync polish translation

Discussion
----------

[Validator] Sync polish translation
2011-07-12 20:06:30 +02:00
Fabien Potencier
582dda5c85 merged branch vicb/fmwk/ide (PR #1657)
Commits
-------

df34e0e [FrameworkBundle] Fix for setting a custom file link format (fixes #1652)

Discussion
----------

[FrameworkBundle] Fix for setting a custom file link format (fixes #1652)

[FrameworkBundle] Fix for setting a custom file link format (fixes #1652)
2011-07-12 20:06:08 +02:00
Fabien Potencier
5cb165c259 merged branch aboks/dutch_translations (PR #1658)
Commits
-------

2227e41 Fixed incorrect indentation
85b6985 [FrameworkBundle] Sync'ed Dutch validator translations

Discussion
----------

[FrameworkBundle] Sync'ed Dutch validator translations
2011-07-12 20:05:34 +02:00
Fabien Potencier
07ddff5862 merged branch jdreesen/validator-trans-update (PR #1654)
Commits
-------

6d87e67 [FrameworkBundle] Updated German validator translation

Discussion
----------

[FrameworkBundle] Updated German validator translation
2011-07-12 20:04:55 +02:00
Deni
95f7eedd63 [FrameworkBundle] Fixed messages of the Choice constraint in all translations. 2011-07-12 21:54:08 +04:00
Arnout Boks
2227e41b7e Fixed incorrect indentation 2011-07-12 19:24:25 +02:00
Arnout Boks
85b6985eb0 [FrameworkBundle] Sync'ed Dutch validator translations 2011-07-12 19:08:04 +02:00
Victor Berchet
df34e0eb29 [FrameworkBundle] Fix for setting a custom file link format (fixes #1652) 2011-07-12 19:01:49 +02:00
Joseph Bielawski
31317ccf61 [Validator] Sync polish translation 2011-07-12 09:57:21 -07:00
jdreesen
6d87e6715d [FrameworkBundle] Updated German validator translation 2011-07-12 18:51:04 +02:00
Geoffrey Tran
91cfb24e40 Made namespace for Doctrine cache unique to each environment
Solves issues with the cache not being valid for the DBAL ACL provider using D2 as the cache and switching environments.

An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in ../vendor/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404")
2011-07-12 11:50:37 -05:00
marc.weistroff
dc14f68171 Added fr translation. 2011-07-12 18:08:54 +02:00
Fabien Potencier
fe6f23163e removed unused use statements 2011-07-12 17:58:39 +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
Emil Einarsson
b96e0d3fea Updated some awkward swedish validator message translations. 2011-07-12 07:17:31 -07:00
Fabien Potencier
51dd916cc8 merged branch vicb/routing/route-annotation (PR #1650)
Commits
-------

2a24603 [Routing] Allow multiple `@Route` annotations with a default name on a single method (fixes #1647)

Discussion
----------

[Routing] Allow multiple `@Route` annotations with a default name

[Routing] Allow multiple `@Route` annotations with a default name on a single method (fixes #1647)

Before this change, the default name would be the same for multiple `@Route` with a default name on the same method. Then only the last declared route is active.

The defaults names are (for consecutive `@Route`s):

  * former_default,
  * former_default_1,
  * former_name,
  * former_default_2,
  * ...

The FrameworkExtraBundle needs to be updated in sync with this PR: https://github.com/sensio/SensioFrameworkExtraBundle/pull/50
2011-07-12 15:41:38 +02:00
Victor Berchet
2a24603061 [Routing] Allow multiple @Route annotations with a default name on a single method (fixes #1647) 2011-07-12 15:30:32 +02:00
yktd26
b2ce732bf9 added chinese translations for validator messages 2011-07-12 15:13:38 +02:00
Fabien Potencier
5eaf884cda [Process] fixed CS 2011-07-12 08:16:22 +02:00
Fabien Potencier
f2a301bc6c merged branch import/master (PR #1637)
Commits
-------

95ca258 Fixed problems with running processes returns wrong exitcode (-1) on Linux.

Discussion
----------

#1636

Fixed problems with running processes returns wrong exitcode (-1) on Linux.

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

by schmittjoh at 2011/07/11 11:07:42 -0700

This doesn't concern this PR specifically, but can we somehow start adding tests for this class? The process component seems like the by far most unstable code that we have.

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

by fabpot at 2011/07/11 23:07:43 -0700

@schmittjoh: Problem is that the behavior highly depends on the platform and PHP version.

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

by fabpot at 2011/07/11 23:14:23 -0700

@schmittjoh: By the way, we have added a bunch of tests recently (2d29a82412 (tests)/Symfony/Tests/Component/Process). Things are also "unstable" because the behavior depends on the amount of input, the amount of output, and when things happens. That means that it is also impossible to cover all possible cases reliably.
2011-07-12 08:15:25 +02:00
Fabien Potencier
baa35f51db merged branch craue/patch-6 (PR #1638)
Commits
-------

d34caee merged and unified blocks `field_label` and `form_label` into `generic_label`

Discussion
----------

merged and unified blocks `field_label` and `form_label` into `generic_label`
2011-07-12 08:10:09 +02:00
Tobias Sjösten
4764cfb8d6 [FrameworkBundle] Added Swedish translation 2011-07-11 23:51:58 +02:00
Christian Raue
d34caeea3a merged and unified blocks field_label and form_label into generic_label 2011-07-11 12:06:28 -07:00
Osman Üngür
95ca258a42 Fixed problems with running processes returns wrong exitcode (-1) on Linux. 2011-07-11 09:37:49 -07: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
be31bc091e [DependencyInjection] made a small performance optimization 2011-07-11 17:55:12 +02:00
Fabien Potencier
f0f83a9f6e merged branch stof/exception_listener (PR #1633)
Commits
-------

11369eb Fixed phpdoc
dbe1854 Added a AccessDeniedHttpException to wrap the AccessDeniedException.

Discussion
----------

Added a AccessDeniedHttpException to wrap the AccessDeniedException.

This is a proposal to fix #1631

It wraps the AccessDeniedException in an AccessDeniedHttpException when the firewall is not able to handle it itself. This allows getting a 403 response using the standard exception listener in this case.

Note that the app should not throw the AccessDeniedHttpException itself but keep using the AccessDeniedException to let the Security component check if the user is already fully authenticated or if it should give a chance to authenticate.

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

by fabpot at 2011/07/11 07:10:12 -0700

For reference, I've tried something more radical some time ago here: https://github.com/symfony/symfony/pull/369.

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

by stof at 2011/07/11 07:22:07 -0700

my implementation is what @schmittjoh suggested in the comments on your PR.
2011-07-11 17:02:32 +02:00
Fabien Potencier
00c7e91182 [HttpKernel] removed special case when using the CLI
* This special case means that functional tests run from the CLI behave differently
* It means that web servers created in PHP behave differently
2011-07-11 16:13:15 +02:00
Christophe Coevoet
11369eb7e4 Fixed phpdoc 2011-07-11 14:08:49 +02:00
Christophe Coevoet
dbe1854e1f Added a AccessDeniedHttpException to wrap the AccessDeniedException.
See #1631
2011-07-11 13:12:24 +02:00
jdreesen
f0765618de [FrameworkBundle] Synced German validator translation 2011-07-11 12:41:21 +02:00
Arnout Boks
bf7ca509a2 [FrameworkBundle] Synced Dutch validator translation 2011-07-11 12:06:18 +02:00
Fabien Potencier
8a653f2335 merged branch stloyd/patch-1 (PR #1629)
Commits
-------

e54ad66 [Validator] Polish translation sync.

Discussion
----------

[Validator] Polish translation sync.
2011-07-11 11:57:54 +02:00
Fabien Potencier
6a7359389d removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version 2011-07-11 11:54:00 +02:00
Joseph Bielawski
e54ad66e7d [Validator] Polish translation sync. 2011-07-11 02:48:27 -07:00
Fabien Potencier
41210b07c7 [FrameworkBundle] fixed form PHP templates for previous merge 2011-07-11 11:38:46 +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
fa78e78f5f [HttpFoundation] added some information in a phpdoc 2011-07-11 11:30:24 +02:00
Fabien Potencier
7f960a10f2 merged branch gbirke/form_error_docs (PR #1599)
Commits
-------

22a49f1 Better docstring for FormError constructor

Discussion
----------

Better docstring for FormError constructor

Better docs for placeholder format of FormError.
2011-07-11 11:28:00 +02:00
Fabien Potencier
c188ca85b9 merged branch vicb/form/translate (PR #1627)
Commits
-------

24e0d71 [FrameworkBundle] Fix a translatable string from the Form default validator
30d348d [Form] Make the default invalid message translatable

Discussion
----------

[Form] Translation

The first commit adds the ability to customize the default message when the form is invalid:

  * Make it an option in the form builder,
  * Allow placeholders in the message,
  * The default value `This value is not valid` exists in the translation files.

The second commit updates a source string in the XLIFF files to make it translatable. All translations should be updated accordingly. The source string is from the [default validator](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Validator/DefaultValidator.php#L27).

This PR should fix The issue #997.

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

by fabpot at 2011/07/11 01:53:05 -0700

The first commit is not about making the message translatable, but to make it customizable (as the message is used for very different purposes depending on the Type).

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

by fabpot at 2011/07/11 01:55:11 -0700

The "This value is not valid" string should be added to the translation files too.

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

by vicb at 2011/07/11 02:02:51 -0700

@fabpot it was not translatable as the name was hardcoded in the message (instead of using a placeholder). So yes it becomes translatable now (and "customize"able as explained in the PR message).

I have also removed the form name from the default message as I don't think it brings any added value.

`This value is not valid` already exists in the translation files (see id=24).
2011-07-11 11:25:45 +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
de2ab0b506 merged branch lenar/patch-3 (PR #1551)
Commits
-------

f7d0f65 RFC2616 changes
b9a218a [HttpFoundation] set Content-Length header to the length of content

Discussion
----------

[HttpFoundation] set Content-Length header to the length of content

I can't think of why this could be bad but if somebody knows please chime in.

The good thing is that with this change keepalive will work out of the box.

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

by Seldaek at 2011/07/06 05:34:51 -0700

That sounds like a great change. I think it might explain/fix the issues I've encountered with AppCache on my production box. Never had time to look into it, but IIRC I noticed the missing Content-Length, and it seemed to load forever.

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

by fabpot at 2011/07/06 06:46:50 -0700

The `Content-Length` is automatically added by servers like Apache. Moreover, sometimes, you should not add it: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

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

by lenar at 2011/07/06 07:54:45 -0700

It is not added automatically by default. Yes, in case of Apache it is actually added if deflate module is enabled and if that module decides to compress the content (decision based on content-type).

About RFC2616: I will read it and add changes to this PR if applicable.

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

by fabpot at 2011/07/06 08:38:14 -0700

e943fde2ef

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

by Seldaek at 2011/07/06 08:45:22 -0700

@lenar all you have to do is skip setting the Content-Length for `1xx`, `204`, and `304` responses I believe.

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

by Seldaek at 2011/07/06 08:46:54 -0700

But this should maybe be done in sendHeaders() à la `fixContentType`, because you can't be sure about the statusCode before that.

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

by lenar at 2011/07/06 13:55:33 -0700

I propose this based on what I read and understood from RFC2616.

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

by mheleniak at 2011/07/10 03:57:26 -0700

+1
2011-07-11 10:58:31 +02:00
DerStoffel
377ef7974f Error Message id 1 & 2 changed in "true" & "false", since direct german translation (wahr, falsch) are properly missleading. Corrected typos. 2011-07-11 01:18:45 -07:00
Victor Berchet
24e0d71d92 [FrameworkBundle] Fix a translatable string from the Form default validator 2011-07-11 08:41:58 +02:00