8000 Merge branch '3.3' into 3.4 · symfony/symfony@a165f1b · GitHub
[go: up one dir, main page]

Skip to content

Commit a165f1b

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: (23 commits) bumped Symfony version to 3.3.11 updated VERSION for 3.3.10 updated CHANGELOG for 3.3.10 bumped Symfony version to 2.8.29 updated VERSION for 2.8.28 updated CHANGELOG for 2.8.28 bumped Symfony version to 2.7.36 updated VERSION for 2.7.35 update CONTRIBUTORS for 2.7.35 updated CHANGELOG for 2.7.35 [Session] fix MongoDb session handler to gc all expired sessions Updated Test name and exception name to be more accurate newline at end of file changed exception message Ahh, I see. It actually wants a newline! Removed newline Created new Exception to throw and modified tests. Created new Exception to throw and modified tests Code standard fixes Changed automatic token generation to throw an exception instead ...
2 parents 0c8043a + 1dfa63f commit a165f1b

File tree

6 files changed

+78
-2
lines changed

6 files changed

+78
-2
lines changed

CHANGELOG-3.3.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@ in 3.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.3.0...v3.3.1
99

10+
* 3.3.10 (2017-10-05)
11+
12+
* bug #23906 Added support for guards when advancing workflow from a command (GDIBass)
13+
* bug #24448 [Session] fix MongoDb session handler to gc all expired sessions (Tobion)
14+
* bug #24431 [FrameworkBundle] Fix bad interface hint in AbstractController (nicolas-grekas)
15+
* bug #24419 [Cache] Fix race condition in TagAwareAdapter (nicolas-grekas)
16+
* bug #24417 [Yaml] parse references on merge keys (xabbuh)
17+
* bug #24416 [Yaml] treat trailing backslashes in multi-line strings (xabbuh)
18+
* bug #24421 [Config] Fix dumped files invalidation by OPCache (nicolas-grekas)
19+
* bug #24418 [DI] Allow setting any public non-initialized services (nicolas-grekas)
20+
* bug #23980 Tests and fix for issue in array model data in EntityType field with multiple=true (stoccc)
21+
* bug #22586 [Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible (aaa2000)
22+
* bug #24157 [Intl] Fixed support of Locale::getFallback (lyrixx)
23+
* bug #24198 [HttpFoundation] Fix file upload multiple with no files (enumag)
24+
* bug #24379 [PHPUnitBridge] don't remove when set to empty string (Simperfit)
25+
* bug #24036 [Form] Fix precision of MoneyToLocalizedStringTransformer's divisions and multiplications (Rubinum)
26+
* bug #24191 [DependencyInjection] include file and line number in deprecation (xabbuh)
27+
* bug #24367 PdoSessionHandler: fix advisory lock for pgsql (Tobion)
28+
* bug #24189 [Yaml] parse merge keys with PARSE_OBJECT_FOR_MAP flag (xabbuh)
29+
* bug #24243 HttpCache does not consider ESI resources in HEAD requests (mpdude)
30+
* bug #24237 [WebProfilerBundle] Added missing link to profile token (vtsykun)
31+
* bug #24244 TwigBundle exception/deprecation tweaks (ro0NL)
32+
* bug #24281 [TwigBundle] Remove profiler related scripting (ro0NL, javiereguiluz)
33+
* bug #24251 [PropertyAccess] Set a NullLogger in ApcuAdapter when Apcu is disabled in CLI (iamluc)
34+
* bug #24304 [FrameworkBundle] Fix Routing\DelegatingLoader (nicolas-grekas)
35+
* bug #24305 [HttpKernel] Make array vs "::" controller definitions consistent (nicolas-grekas)
36+
* bug #24255 [TwigBundle] Break long lines in exceptions (kevin-verschaeve)
37+
* bug #24219 [Console] Preserving line breaks between sentences according to the exception message (yceruto)
38+
* bug #24192 [PhpUnitBridge] do not require an error context (xabbuh)
39+
* bug #23722 [Form] Fixed GroupSequence with "constraints" option (HeahDude)
40+
* bug #22321 [Filesystem] Fixed makePathRelative (ausi)
41+
* bug #24234 [DI] Fix decorated service merge in ResolveInstanceofConditionalsPass (dunglas)
42+
* bug #24203 [Security] Preserve URI fragment in HttpUtils::generateUri() (chalasr)
43+
* bug #24199 [DI] Fix non-instantiables auto-discovery (nicolas-grekas)
44+
* bug #23473 [Filesystem] mirror - fix copying content with same name as source/target. (gitlost)
45+
* bug #24177 [FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase (yceruto)
46+
* bug #24162 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces (fabpot)
47+
1048
* 3.3.9 (2017-09-11)
1149

1250
* bug #24141 [DomCrawler] Fix conversion to int on GetPhpFiles (MaraBlaga)

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function destroy($sessionId)
127127
*/
128128
public function gc($maxlifetime)
129129
{
130-
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
130+
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteMany' : 'remove';
131131

132132
$this->getCollection()->$methodName(array(
133133
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function testGc()
286286
->with($this->options['database'], $this->options['collection'])
287287
->will($this->returnValue($collection));
288288

289-
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
289+
$methodName = phpversion('mongodb') ? 'deleteMany' : 'remove';
290290

291291
$collection->expects($this->once())
292292
->method($methodName)

src/Symfony/Component/Workflow/EventListener/GuardListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1717
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
1818
use Symfony\Component\Workflow\Event\GuardEvent;
19+
use Symfony\Component\Workflow\Exception\InvalidTokenConfigurationException;
1920

2021
/**
2122
* @author Grégoire Pineau <lyrixx@lyrixx.info>
@@ -55,6 +56,10 @@ private function getVariables(GuardEvent $event)
5556
{
5657
$token = $this->tokenStorage->getToken();
5758

59+
if (null === $token) {
60+
throw new InvalidTokenConfigurationException(sprintf('There are no tokens available for workflow %s.', $event->getWorkflowName()));
61+
}
62+
5863
if (null !== $this->roleHierarchy) {
5964
$roles = $this->roleHierarchy->getReachableRoles($token->getRoles());
6065
} else {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Workflow\Exception;
13+
14+
/**
15+
* Thrown by GuardListener when there is no token set, but guards are placed on a transition.
16+
*
17+
* @author Matt Johnson <matj1985@gmail.com>
18+
*/
19+
class InvalidTokenConfigurationException extends LogicException implements ExceptionInterface
20+
{
21+
}

src/Symfony/Component/Workflow/Tests/EventListener/GuardListenerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ public function testWithSupportedEventAndAccept()
6969
$this->assertTrue($event->isBlocked());
7070
}
7171

72+
/**
73+
* @expectedException \Symfony\Component\Workflow\Exception\InvalidTokenConfigurationException
74+
* @expectedExceptionMessage There are no tokens available for workflow unnamed.
75+
*/
76+
public function testWithNoTokensInTokenStorage()
77+
{
78+
$event = $this->createEvent();
79+
$this->tokenStorage->setToken(null);
80+
81+
$this->listener->onTransition($event, 'event_name_a');
82+
}
83+
7284
private function createEvent()
7385
{
7486
$subject = new \stdClass();

0 commit comments

Comments
 (0)
0