Skip to content

Commit d8ee14f

Browse files
committed
Merge branch '3.4'
* 3.4: [TwigBridge] Bootstrap 4 form theme fixes [VarDumper] HtmlDumper: fix collapsing nodes with depth <= maxDepth Fixing a bug where non-existent classes would cause issues Do not activate the cache if Doctrine's cache is not present [SecurityBundle] hotfix: update phpdocs on logout url [FrameworkBundle] Do not load property_access.xml if the component isn't installed [HttpFoundation] Mark new methods on Response as final Fixed a few spelling mistakes in Luxembourgish translation [TwigBridge] Fix template paths in profiler
2 parents d222648 + b327a7c commit d8ee14f

File tree

9 files changed

+56
-21
lines changed

9 files changed

+56
-21
lines changed

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,18 @@ public function lateCollect()
6363
$this->data['template_paths'] = array();
6464

6565
$templateFinder = function (Profile $profile) use (&$templateFinder) {
66-
if ($profile->isTemplate() && $template = $this->twig->load($profile->getName())->getSourceContext()->getPath()) {
67-
$this->data['template_paths'][$profile->getName()] = $template;
66+
if ($profile->isTemplate()) {
67+
try {
68+
$template = $this->twig->load($name = $profile->getName());
69+
} catch (\Twig_Error_Loader $e) {
70+
$template = null;
71+
}
72+
73+
if (null !== $template && '' !== $path = $template->getSourceContext()->getPath()) {
74+
$this->data['template_paths'][$name] = $path;
75+
}
6876
}
77+
6978
foreach ($profile as $p) {
7079
$templateFinder($p);
7180
}

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
{# Labels #}
7171

7272
{% block form_label -%}
73-
{%- if expanded is defined and expanded -%}
73+
{%- if compound is defined and compound -%}
7474
{%- set element = 'legend' -%}
7575
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-legend')|trim}) -%}
76+
{%- else -%}
77+
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%}
7678
{%- endif -%}
77-
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%}
7879
{{- parent() -}}
7980
{%- endblock form_label %}
8081

@@ -107,7 +108,7 @@
107108
{# Rows #}
108109

109110
{% block form_row -%}
110-
{%- if expanded is defined and expanded -%}
111+
{%- if compound is defined and compound -%}
111112
{%- set element = 'fieldset' -%}
112113
{%- endif -%}
113114
<{{ element|default('div') }} class="form-group">

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,18 @@ public function filterToServiceTypes($serviceId)
242242
return false;
243243
}
244244

245-
// see if the class exists (only need to trigger autoload once)
246-
return class_exists($serviceId) || interface_exists($serviceId, false);
245+
// if the id has a \, assume it is a class
246+
if (false !== strpos($serviceId, '\\')) {
247+
return true;
248+
}
249+
250+
try {
251+
$r = new \ReflectionClass($serviceId);
252+
253+
return true;
254+
} catch (\ReflectionException $e) {
255+
// the service id is not a valid class/interface
256+
return false;
257+
}
247258
}
248259
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

1414
use Doctrine\Common\Annotations\Annotation;
15+
use Doctrine\Common\Cache\Cache;
1516
use Symfony\Bundle\FullStack;
1617
use Symfony\Component\Asset\Package;
1718
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
@@ -676,7 +677,7 @@ private function addAnnotationsSection(ArrayNodeDefinition $rootNode)
676677
->info('annotation configuration')
677678
->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
678679
->children()
679-
->scalarNode('cache')->defaultValue('php_array')->end()
680+
->scalarNode('cache')->defaultValue(interface_exists(Cache::class) ? 'php_array' : 'none')->end()
680681
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()
681682
->booleanNode('debug')->defaultValue($this->debug)->end()
682683
->end()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ public function load(array $configs, ContainerBuilder $container)
127127
}
128128
}
129129

130-
// Property access is used by both the Form and the Validator component
131-
$loader->load('property_access.xml');
132-
133130
// Load Cache configuration first as it is used by other components
134131
$loader->load('cache.xml');
135132

@@ -237,7 +234,7 @@ public function load(array $configs, ContainerBuilder $container)
237234
$this->registerDebugConfiguration($config['php_errors'], $container, $loader);
238235
$this->registerRouterConfiguration($config['router'], $container, $loader);
239236
$this->registerAnnotationsConfiguration($config['annotations'], $container, $loader);
240-
$this->registerPropertyAccessConfiguration($config['property_access'], $container);
237+
$this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader);
241238

242239
if ($this->isConfigEnabled($container, $config['serializer'])) {
243240
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
@@ -1096,8 +1093,14 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10961093
}
10971094
}
10981095

1099-
private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container)
1096+
private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
11001097
{
1098+
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) {
1099+
return;
1100+
}
1101+
1102+
$loader->load('property_access.xml');
1103+
11011104
$container
11021105
->getDefinition('property_accessor')
11031106
->replaceArgument(0, $config['magic_call'])
@@ -1133,6 +1136,11 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
11331136

11341137
$chainLoader = $container->getDefinition('serializer.mapping.chain_loader');
11351138

1139+
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) {
1140+
$container->removeAlias('serializer.property_accessor');
1141+
$container->removeDefinition('serializer.normalizer.object');
1142+
}
1143+
11361144
$serializerLoaders = array();
11371145
if (isset($config['enable_annotations']) && $config['enable_annotations']) {
11381146
if (!$this->annotationsConfigEnabled) {

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ public function getToken()
296296
}
297297

298298
/**
299-
* Get the provider key (i.e. the name of the active firewall).
299+
* Get the logout URL.
300300
*
301-
* @return string The provider key
301+
* @return string The logout URL
302302
*/
303303
public function getLogoutUrl()
304304
{

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ public function setPublic()
612612
* @param bool $immutable enables or disables the immutable directive
613613
*
614614
* @return $this
615+
*
616+
* @final
615617
*/
616618
public function setImmutable($immutable = true)
617619
{
@@ -628,6 +630,8 @@ public function setImmutable($immutable = true)
628630
* Returns true if the response is marked as "immutable".
629631
*
630632
* @return bool returns true if the response is marked as "immutable"; otherwise false
633+
*
634+
* @final
631635
*/
632636
public function isImmutable()
633637
{

src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
</trans-unit>
141141
<trans-unit id="38">
142142
<source>This value is not a valid language.</source>
143-
<target>Dëse Wäert aentsprécht kenger gëlteger Sprooch.</target>
143+
<target>Dëse Wäert entsprécht kenger gëlteger Sprooch.</target>
144144
</trans-unit>
145145
<trans-unit id="39">
146146
<source>This value is not a valid locale.</source>
@@ -180,7 +180,7 @@
180180
</trans-unit>
181181
<trans-unit id="48">
182182
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
183-
<target>Dëse Wäert sollt exactly {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn.</target>
183+
<target>Dëse Wäert sollt exakt {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn.</target>
184184
</trans-unit>
185185
<trans-unit id="49">
186186
<source>The file was only partially uploaded.</source>
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51">
194194
<source>No temporary folder was configured in php.ini.</source>
195-
<target>Et gouf keen temporären Dossier an der php.ini konfiguréiert.</target>
195+
<target>Et gouf keen temporären Dossier an der php.ini konfiguréiert oder den temporären Dossier existéiert net.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>
@@ -304,7 +304,7 @@
304304
</trans-unit>
305305
<trans-unit id="79">
306306
<source>The host could not be resolved.</source>
307-
<target>Den Domain-Numm konnt net opgeléist ginn.</target>
307+
<target>Den Host-Numm konnt net opgeléist ginn.</target>
308308
</trans-unit>
309309
<trans-unit id="80">
310310
<source>This value does not match the expected {{ charset }} charset.</source>

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,9 @@ function xpathString(str) {
383383
x += elt.parentNode.getAttribute('data-depth')/1;
384384
}
385385
elt.setAttribute('data-depth', x);
386-
if (elt.className ? 'sf-dump-expanded' !== elt.className : (x > options.maxDepth)) {
387-
elt.className = 'sf-dump-expanded';
386+
var className = elt.className;
387+
elt.className = 'sf-dump-expanded';
388+
if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) {
388389
toggle(a);
389390
}
390391
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {

0 commit comments

Comments
 (0)