From c9174dff7c3eb92de0df68240e12db8790fd4625 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Fri, 27 Oct 2017 19:43:59 +0200 Subject: [PATCH 1/9] [TwigBridge] Fix template paths in profiler --- .../Bridge/Twig/DataCollector/TwigDataCollector.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php index 66f2a764e7..c1956974f8 100644 --- a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php +++ b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php @@ -63,9 +63,18 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf $this->data['template_paths'] = array(); $templateFinder = function (Profile $profile) use (&$templateFinder) { - if ($profile->isTemplate() && $template = $this->twig->load($profile->getName())->getSourceContext()->getPath()) { - $this->data['template_paths'][$profile->getName()] = $template; + if ($profile->isTemplate()) { + try { + $template = $this->twig->load($name = $profile->getName()); + } catch (\Twig_Error_Loader $e) { + $template = null; + } + + if (null !== $template && '' !== $path = $template->getSourceContext()->getPath()) { + $this->data['template_paths'][$name] = $path; + } } + foreach ($profile as $p) { $templateFinder($p); } From 7a81576b97da2ab7ebd67cf6aeb3aacaf5d627ad Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Sat, 28 Oct 2017 16:13:03 +0200 Subject: [PATCH 2/9] Fixed a few spelling mistakes in Luxembourgish translation Also adjusted trans-unit "51" to commit #21335 --- .../Validator/Resources/translations/validators.lb.xlf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf index d631797018..668b2a631e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf @@ -140,7 +140,7 @@ This value is not a valid language. - Dëse Wäert aentsprécht kenger gëlteger Sprooch. + Dëse Wäert entsprécht kenger gëlteger Sprooch. This value is not a valid locale. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Dëse Wäert sollt exactly {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn. + Dëse Wäert sollt exakt {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn. The file was only partially uploaded. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Et gouf keen temporären Dossier an der php.ini konfiguréiert. + Et gouf keen temporären Dossier an der php.ini konfiguréiert oder den temporären Dossier existéiert net. Cannot write temporary file to disk. @@ -304,7 +304,7 @@ The host could not be resolved. - Den Domain-Numm konnt net opgeléist ginn. + Den Host-Numm konnt net opgeléist ginn. This value does not match the expected {{ charset }} charset. From a913f705831f5e8bbbab5623ed09c9959769ecb5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 28 Oct 2017 20:22:29 +0200 Subject: [PATCH 3/9] [HttpFoundation] Mark new methods on Response as final --- src/Symfony/Component/HttpFoundation/Response.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 765e388520..9c98203147 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -612,6 +612,8 @@ class Response * @param bool $immutable enables or disables the immutable directive * * @return $this + * + * @final */ public function setImmutable($immutable = true) { @@ -628,6 +630,8 @@ class Response * Returns true if the response is marked as "immutable". * * @return bool returns true if the response is marked as "immutable"; otherwise false + * + * @final */ public function isImmutable() { From d297e2760026f2898a400c3dcc9da50841fcd802 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Wed, 18 Oct 2017 16:30:35 +0200 Subject: [PATCH 4/9] [FrameworkBundle] Do not load property_access.xml if the component isn't installed --- .../DependencyInjection/FrameworkExtension.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 85a1a9ba20..1d2eb1d8b3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -63,9 +63,6 @@ class FrameworkExtension extends Extension // will be used and everything will still work as expected. $loader->load('translation.xml'); - // Property access is used by both the Form and the Validator component - $loader->load('property_access.xml'); - $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); @@ -129,7 +126,7 @@ class FrameworkExtension extends Extension } $this->registerAnnotationsConfiguration($config['annotations'], $container, $loader); - $this->registerPropertyAccessConfiguration($config['property_access'], $container); + $this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader); if (isset($config['serializer'])) { $this->registerSerializerConfiguration($config['serializer'], $container, $loader); @@ -852,8 +849,14 @@ class FrameworkExtension extends Extension } } - private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container) + private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) { + if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) { + return; + } + + $loader->load('property_access.xml'); + $container ->getDefinition('property_accessor') ->replaceArgument(0, $config['magic_call']) @@ -900,6 +903,11 @@ class FrameworkExtension extends Extension $loader->load('serializer.xml'); $chainLoader = $container->getDefinition('serializer.mapping.chain_loader'); + if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) { + $container->removeAlias('serializer.property_accessor'); + $container->removeDefinition('serializer.normalizer.object'); + } + $serializerLoaders = array(); if (isset($config['enable_annotations']) && $config['enable_annotations']) { $annotationLoader = new Definition( From 8df6787e7a8a8348551335fea6816945afa9b243 Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Sun, 29 Oct 2017 08:35:26 +0100 Subject: [PATCH 5/9] [SecurityBundle] hotfix: update phpdocs on logout url --- .../SecurityBundle/DataCollector/SecurityDataCollector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index ad65b51d60..6ac33dbb92 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -169,9 +169,9 @@ class SecurityDataCollector extends DataCollector } /** - * Get the provider key (i.e. the name of the active firewall). + * Get the logout URL. * - * @return string The provider key + * @return string The logout URL */ public function getLogoutUrl() { From c5c7a2304d1b46dda990d1e5bf34283bde499f43 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Sun, 29 Oct 2017 16:04:35 +0000 Subject: [PATCH 6/9] Do not activate the cache if Doctrine's cache is not present --- .../FrameworkBundle/DependencyInjection/Configuration.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 14c61e1395..7c7cc59142 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; use Doctrine\Common\Annotations\Annotation; +use Doctrine\Common\Cache\Cache; use Symfony\Bundle\FullStack; use Symfony\Component\Asset\Package; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; @@ -741,7 +742,7 @@ class Configuration implements ConfigurationInterface ->info('annotation configuration') ->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}() ->children() - ->scalarNode('cache')->defaultValue('php_array')->end() + ->scalarNode('cache')->defaultValue(interface_exists(Cache::class) ? 'php_array' : 'none')->end() ->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end() ->booleanNode('debug')->defaultValue($this->debug)->end() ->end() From 4bb9d8207f76b8760ee0023790065273b5a44a12 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 29 Oct 2017 13:47:23 -0400 Subject: [PATCH 7/9] Fixing a bug where non-existent classes would cause issues --- .../Command/ContainerDebugCommand.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index 810c9972b5..21d1e6d3c9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -238,7 +238,18 @@ EOF return false; } - // see if the class exists (only need to trigger autoload once) - return class_exists($serviceId) || interface_exists($serviceId, false); + // if the id has a \, assume it is a class + if (false !== strpos($serviceId, '\\')) { + return true; + } + + try { + $r = new \ReflectionClass($serviceId); + + return true; + } catch (\ReflectionException $e) { + // the service id is not a valid class/interface + return false; + } } } From a1863c3b7c29cd8b0fbb2225fe95f97a4c3478d7 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sun, 29 Oct 2017 21:05:50 +0100 Subject: [PATCH 8/9] [VarDumper] HtmlDumper: fix collapsing nodes with depth <= maxDepth --- src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index e554d4ae5f..37c1a1a468 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -383,8 +383,9 @@ return function (root, x) { x += elt.parentNode.getAttribute('data-depth')/1; } elt.setAttribute('data-depth', x); - if (elt.className ? 'sf-dump-expanded' !== elt.className : (x > options.maxDepth)) { - elt.className = 'sf-dump-expanded'; + var className = elt.className; + elt.className = 'sf-dump-expanded'; + if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) { toggle(a); } } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { From e55c67ad178bc6ff8c5b92ccb650cc303e934459 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Fri, 27 Oct 2017 04:40:00 +0300 Subject: [PATCH 9/9] [TwigBridge] Bootstrap 4 form theme fixes --- .../Twig/Resources/views/Form/bootstrap_4_layout.html.twig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 7dda32ace2..f9cb62209d 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -70,11 +70,12 @@ {# Labels #} {% block form_label -%} - {%- if expanded is defined and expanded -%} + {%- if compound is defined and compound -%} {%- set element = 'legend' -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-legend')|trim}) -%} + {%- else -%} + {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%} {%- endif -%} - {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%} {{- parent() -}} {%- endblock form_label %} @@ -107,7 +108,7 @@ {# Rows #} {% block form_row -%} - {%- if expanded is defined and expanded -%} + {%- if compound is defined and compound -%} {%- set element = 'fieldset' -%} {%- endif -%} <{{ element|default('div') }} class="form-group">