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

Skip to content

Commit df41ca5

Browse files
Merge branch '3.4' into 4.4
* 3.4: [FrameworkBundle] fix "samesite" in XSD Update UserPasswordEncoderCommand.php [HttpFoundation][FrameworkBundle] fix support for samesite in session cookies [DoctrineBridge] Fixed submitting ids with query limit or offset
2 parents 53fcf72 + abac71b commit df41ca5

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getEntitiesByIds($identifier, array $values)
5757
$metadata = $this->queryBuilder->getEntityManager()->getClassMetadata(current($this->queryBuilder->getRootEntities()));
5858

5959
foreach ($this->getEntities() as $entity) {
60-
if (\in_array(current($metadata->getIdentifierValues($entity)), $values, true)) {
60+
if (\in_array((string) current($metadata->getIdentifierValues($entity)), $values, true)) {
6161
$choices[] = $entity;
6262
}
6363
}

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,32 @@ public function testDisallowChoicesThatAreNotIncludedQueryBuilderSingleIdentifie
953953
$this->assertNull($field->getData());
954954
}
955955

956-
public function testDisallowChoicesThatAreNotIncludedQueryBuilderSingleIdentifierWithLimit()
956+
public function testSingleIdentifierWithLimit()
957+
{
958+
$entity1 = new SingleIntIdEntity(1, 'Foo');
959+
$entity2 = new SingleIntIdEntity(2, 'Bar');
960+
$entity3 = new SingleIntIdEntity(3, 'Baz');
961+
962+
$this->persist([$entity1, $entity2, $entity3]);
963+
964+
$repository = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
965+
966+
$field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
967+
'em' => 'default',
968+
'class' => self::SINGLE_IDENT_CLASS,
969+
'query_builder' => $repository->createQueryBuilder('e')
970+
->where('e.id IN (1, 2, 3)')
971+
->setMaxResults(1),
972+
'choice_label' => 'name',
973+
]);
974+
975+
$field->submit('1');
976+
977+
$this->assertTrue($field->isSynchronized());
978+
$this->assertSame($entity1, $field->getData());
979+
}
980+
981+
public function testDisallowChoicesThatAreNotIncludedByQueryBuilderSingleIdentifierWithLimit()
957982
{
958983
$entity1 = new SingleIntIdEntity(1, 'Foo');
959984
$entity2 = new SingleIntIdEntity(2, 'Bar');

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@
375375
<xsd:simpleType name="cookie_samesite">
376376
<xsd:restriction base="xsd:string">
377377
<xsd:enumeration value="" />
378+
<xsd:enumeration value="none" />
378379
<xsd:enumeration value="lax" />
379380
<xsd:enumeration value="strict" />
380381
</xsd:restriction>

src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ protected function configure()
8282
Pass the full user class path as the second argument to encode passwords for
8383
your own entities:
8484
85-
<info>php %command.full_name% --no-interaction [password] App\Entity\User</info>
85+
<info>php %command.full_name% --no-interaction [password] 'App\Entity\User'</info>
8686
8787
Executing the command interactively allows you to generate a random salt for
8888
encoding the password:
8989
90-
<info>php %command.full_name% [password] App\Entity\User</info>
90+
<info>php %command.full_name% [password] 'App\Entity\User'</info>
9191
9292
In case your encoder doesn't require a salt, add the <comment>empty-salt</comment 58E6 > option:
9393
94-
<info>php %command.full_name% --empty-salt [password] App\Entity\User</info>
94+
<info>php %command.full_name% --empty-salt [password] 'App\Entity\User'</info>
9595
9696
EOF
9797
)

0 commit comments

Comments
 (0)
0