From ff5517e554bdd15c543930edf0ec25819dca3bc9 Mon Sep 17 00:00:00 2001 From: Alexandre Segura Date: Mon, 10 Jun 2019 10:21:04 +0200 Subject: [PATCH 1/3] Add missing rendering of form help block. --- .../Twig/Resources/views/Form/bootstrap_3_layout.html.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index 11e8f3f70b..09d2180994 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -114,6 +114,7 @@
{{- form_label(form) }} {# -#} {{ form_widget(form, widget_attr) }} {# -#} + {{- form_help(form) -}} {{ form_errors(form) }} {# -#}
{# -#} {%- endblock form_row %} From 7a4570dcac3335a12547c3299c8ded9101417795 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 22 Jun 2019 22:10:25 +0200 Subject: [PATCH 2/3] fix accessing session bags --- .../HttpFoundation/Session/Session.php | 4 ++- .../Tests/Session/SessionTest.php | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index 867ceba97f..db0b9aeb0b 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -253,7 +253,9 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable */ public function getBag($name) { - return $this->storage->getBag($name)->getBag(); + $bag = $this->storage->getBag($name); + + return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php index afa00fc7c3..acb129984e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php @@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\SessionBagProxy; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; /** @@ -260,4 +261,28 @@ class SessionTest extends TestCase $flash->get('hello'); $this->assertTrue($this->session->isEmpty()); } + + public function testGetBagWithBagImplementingGetBag() + { + $bag = new AttributeBag(); + $bag->setName('foo'); + + $storage = new MockArraySessionStorage(); + $storage->registerBag($bag); + + $this->assertSame($bag, (new Session($storage))->getBag('foo')); + } + + public function testGetBagWithBagNotImplementingGetBag() + { + $data = []; + + $bag = new AttributeBag(); + $bag->setName('foo'); + + $storage = new MockArraySessionStorage(); + $storage->registerBag(new SessionBagProxy($bag, $data, $usageIndex)); + + $this->assertSame($bag, (new Session($storage))->getBag('foo')); + } } From 71eb8cfe99acd34710c81af3ac04660ed1df523f Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Tue, 25 Jun 2019 07:47:15 +0200 Subject: [PATCH 3/3] [Lock] fix missing inherit docs in RedisStore --- src/Symfony/Component/Lock/Store/RedisStore.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Lock/Store/RedisStore.php b/src/Symfony/Component/Lock/Store/RedisStore.php index 496ce65778..39360de45c 100644 --- a/src/Symfony/Component/Lock/Store/RedisStore.php +++ b/src/Symfony/Component/Lock/Store/RedisStore.php @@ -71,6 +71,9 @@ class RedisStore implements StoreInterface $this->checkNotExpired($key); } + /** + * {@inheritdoc} + */ public function waitAndSave(Key $key) { throw new InvalidArgumentException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this)));