diff --git a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php index c6e4ab3a30..d407f8e0e8 100644 --- a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php @@ -81,7 +81,11 @@ class DoctrineTokenProvider implements TokenProviderInterface $sql = 'DELETE FROM rememberme_token WHERE series=:series'; $paramValues = ['series' => $series]; $paramTypes = ['series' => \PDO::PARAM_STR]; - $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + if (method_exists($this->conn, 'executeStatement')) { + $this->conn->executeStatement($sql, $paramValues, $paramTypes); + } else { + $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + } } /** @@ -101,7 +105,11 @@ class DoctrineTokenProvider implements TokenProviderInterface 'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE, 'series' => \PDO::PARAM_STR, ]; - $updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + if (method_exists($this->conn, 'executeStatement')) { + $updated = $this->conn->executeStatement($sql, $paramValues, $paramTypes); + } else { + $updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + } if ($updated < 1) { throw new TokenNotFoundException('No token found.'); } @@ -129,6 +137,10 @@ class DoctrineTokenProvider implements TokenProviderInterface 'value' => \PDO::PARAM_STR, 'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE, ]; - $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + if (method_exists($this->conn, 'executeStatement')) { + $this->conn->executeStatement($sql, $paramValues, $paramTypes); + } else { + $this->conn->executeUpdate($sql, $paramValues, $paramTypes); + } } } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/RememberMe/DoctrineTokenProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/RememberMe/DoctrineTokenProviderTest.php index df696ff7ff..1e36454c41 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/RememberMe/DoctrineTokenProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/RememberMe/DoctrineTokenProviderTest.php @@ -72,7 +72,7 @@ class DoctrineTokenProviderTest extends TestCase 'driver' => 'pdo_sqlite', 'url' => 'sqlite:///:memory:', ]); - $connection->executeUpdate(<<< 'SQL' + $connection->{method_exists($this->conn, 'executeStatement') ? 'executeStatement' : 'executeUpdate'}(<<< 'SQL' CREATE TABLE rememberme_token ( series char(88) UNIQUE PRIMARY KEY NOT NULL, value char(88) NOT NULL, diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index 48d5bdef73..02a4db7d69 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -113,7 +113,11 @@ trait PdoTrait $table->setPrimaryKey([$this->idCol]); foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } return; @@ -144,7 +148,11 @@ trait PdoTrait throw new \DomainException(sprintf('Creating the cache table is currently not implemented for PDO driver "%s".', $this->driver)); } - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } /** @@ -256,7 +264,11 @@ trait PdoTrait } try { - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } catch (TableNotFoundException $e) { } catch (\PDOException $e) { } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 4be8814977..dce846f10e 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -368,7 +368,7 @@ class ChoiceType extends AbstractType 'value' => $choiceView->value, 'label' => $choiceView->label, 'attr' => $choiceView->attr, - 'translation_domain' => $options['translation_domain'], + 'translation_domain' => $options['choice_translation_domain'], 'block_name' => 'entry', ]; diff --git a/src/Symfony/Component/Form/Resources/translations/validators.en.xlf b/src/Symfony/Component/Form/Resources/translations/validators.en.xlf index 89814258d1..97ed83fd47 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.en.xlf @@ -18,6 +18,102 @@ This value is not a valid HTML5 color. This value is not a valid HTML5 color. + + Please enter a valid birthdate. + Please enter a valid birthdate. + + + The selected choice is invalid. + The selected choice is invalid. + + + The collection is invalid. + The collection is invalid. + + + Please select a valid color. + Please select a valid color. + + + Please select a valid country. + Please select a valid country. + + + Please select a valid currency. + Please select a valid currency. + + + Please choose a valid date interval. + Please choose a valid date interval. + + + Please enter a valid date and time. + Please enter a valid date and time. + + + Please enter a valid date. + Please enter a valid date. + + + Please select a valid file. + Please select a valid file. + + + The hidden field is invalid. + The hidden field is invalid. + + + Please enter an integer. + Please enter an integer. + + + Please select a valid language. + Please select a valid language. + + + Please select a valid locale. + Please select a valid locale. + + + Please enter a valid money amount. + Please enter a valid money amount. + + + Please enter a number. + Please enter a number. + + + The password is invalid. + The password is invalid. + + + Please enter a percentage value. + Please enter a percentage value. + + + The values do not match. + The values do not match. + + + Please enter a valid time. + Please enter a valid time. + + + Please select a valid timezone. + Please select a valid timezone. + + + Please enter a valid URL. + Please enter a valid URL. + + + Please enter a valid search term. + Please enter a valid search term. + + + Please provide a valid phone number. + Please provide a valid phone number. + diff --git a/src/Symfony/Component/Form/Resources/translations/validators.tl.xlf b/src/Symfony/Component/Form/Resources/translations/validators.tl.xlf index 02def0bf31..950c4110d8 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.tl.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.tl.xlf @@ -14,6 +14,106 @@ The CSRF token is invalid. Please try to resubmit the form. Hindi balido ang CSRF token. Maagpasa muli ng isang pang porma. + + This value is not a valid HTML5 color. + Ang halagang ito ay hindi wastong HTML5 color. + + + Please enter a valid birthdate. + Pakilagay ang tamang petsa ng kapanganakan. + + + The selected choice is invalid. + Ang pinagpiliang sagot ay hindi tama. + + + The collection is invalid. + Hindi balido ang koleksyon. + + + Please select a valid color. + Pakipiliin ang nararapat na kulay. + + + Please select a valid country. + Pakipiliin ang nararapat na bansa. + + + Please select a valid currency. + Pakipiliin ang tamang pananalapi. + + + Please choose a valid date interval. + Piliin ang wastong agwat ng petsa. + + + Please enter a valid date and time. + Piliin ang wastong petsa at oras. + + + Please enter a valid date. + Ilagay ang wastong petsa. + + + Please select a valid file. + Piliin ang balidong file. + + + The hidden field is invalid. + Hindi balido ang field na nakatago. + + + Please enter an integer. + Pakilagay ang integer. + + + Please select a valid language. + Piliin ang nararapat na lengguwahe. + + + Please select a valid locale. + Pakipili ang nararapat na locale. + + + Please enter a valid money amount. + Pakilagay ang tamang halaga ng pera. + + + Please enter a number. + Ilagay ang numero. + + + The password is invalid. + Hindi balido ang password. + + + Please enter a percentage value. + Pakilagay ang tamang porsyento ng halaga. + + + The values do not match. + Hindi tugma ang mga halaga. + + + Please enter a valid time. + Pakilagay ang tamang oras. + + + Please select a valid timezone. + Pakilagay ang tamang sona ng oras. + + + Please enter a valid URL. + Pakilagay ang balidong URL. + + + Please enter a valid search term. + Pakilagay ang balidong katagang sinasaliksik. + + + Please provide a valid phone number. + Pakilagay ang balidong numero ng telepono. + diff --git a/src/Symfony/Component/Form/Resources/translations/validators.vi.xlf b/src/Symfony/Component/Form/Resources/translations/validators.vi.xlf index b5b2f83a9a..4d060fbe0d 100644 --- a/src/Symfony/Component/Form/Resources/translations/validators.vi.xlf +++ b/src/Symfony/Component/Form/Resources/translations/validators.vi.xlf @@ -4,7 +4,7 @@ This form should not contain extra fields. - Mẫu này không nên chứa trường mở rộng + Mẫu này không nên chứa trường mở rộng. The uploaded file was too large. Please try to upload a smaller file. @@ -14,6 +14,106 @@ The CSRF token is invalid. Please try to resubmit the form. CSRF token không hợp lệ. Vui lòng thử lại. + + This value is not a valid HTML5 color. + Giá trị này không phải là màu HTML5 hợp lệ. + + + Please enter a valid birthdate. + Vui lòng nhập ngày sinh hợp lệ. + + + The selected choice is invalid. + Lựa chọn không hợp lệ. + + + The collection is invalid. + Danh sách không hợp lệ. + + + Please select a valid color. + Vui lòng chọn một màu hợp lệ. + + + Please select a valid country. + Vui lòng chọn đất nước hợp lệ. + + + Please select a valid currency. + Vui lòng chọn tiền tệ hợp lệ. + + + Please choose a valid date interval. + Vui lòng chọn một khoảng thời gian hợp lệ. + + + Please enter a valid date and time. + Vui lòng nhập ngày và thời gian hợp lệ. + + + Please enter a valid date. + Vui lòng nhập ngày hợp lệ. + + + Please select a valid file. + Vui lòng chọn tệp hợp lệ. + + + The hidden field is invalid. + Phạm vi ẩn không hợp lệ. + + + Please enter an integer. + Vui lòng nhập một số nguyên. + + + Please select a valid language. + Vui lòng chọn ngôn ngữ hợp lệ. + + + Please select a valid locale. + Vui lòng chọn miền hợp lệ. + + + Please enter a valid money amount. + Vui lòng nhập một khoảng tiền hợp lệ. + + + Please enter a number. + Vui lòng nhập một con số. + + + The password is invalid. + Mật khẩu không hợp lệ. + + + Please enter a percentage value. + Vui lòng nhập một giá trị phần trăm. + + + The values do not match. + Các giá trị không phù hợp. + + + Please enter a valid time. + Vui lòng nhập thời gian hợp lệ. + + + Please select a valid timezone. + Vui lòng chọn múi giờ hợp lệ. + + + Please enter a valid URL. + Vui lòng nhập một URL hợp lệ. + + + Please enter a valid search term. + Vui lòng nhập chuỗi tìm kiếm hợp lệ. + + + Please provide a valid phone number. + Vui lòng cung cấp số điện thoại hợp lệ. + diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php index e82ab917c5..547e86fbfb 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php @@ -1997,6 +1997,24 @@ class ChoiceTypeTest extends BaseTypeTest $this->assertEquals('_09name', $view->vars['full_name']); } + public function testSubFormTranslationDomain() + { + $form = $this->factory->create(static::TESTED_TYPE, null, [ + 'label' => 'label', + 'translation_domain' => 'label_translation_domain', + 'choices' => [ + 'choice1' => true, + 'choice2' => false, + ], + 'choice_translation_domain' => 'choice_translation_domain', + 'expanded' => true, + ])->createView(); + + $this->assertCount(2, $form->children); + $this->assertSame('choice_translation_domain', $form->children[0]->vars['translation_domain']); + $this->assertSame('choice_translation_domain', $form->children[1]->vars['translation_domain']); + } + /** * @dataProvider provideTrimCases */ diff --git a/src/Symfony/Component/Lock/Store/PdoStore.php b/src/Symfony/Component/Lock/Store/PdoStore.php index 22aec6b916..4de05b4077 100644 --- a/src/Symfony/Component/Lock/Store/PdoStore.php +++ b/src/Symfony/Component/Lock/Store/PdoStore.php @@ -267,7 +267,11 @@ class PdoStore implements StoreInterface $table->setPrimaryKey([$this->idCol]); foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } return; @@ -293,7 +297,11 @@ class PdoStore implements StoreInterface throw new \DomainException(sprintf('Creating the lock table is currently not implemented for PDO driver "%s".', $driver)); } - $conn->exec($sql); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } /** @@ -303,7 +311,12 @@ class PdoStore implements StoreInterface { $sql = "DELETE FROM $this->table WHERE $this->expirationCol <= {$this->getCurrentTimestampStatement()}"; - $this->getConnection()->exec($sql); + $conn = $this->getConnection(); + if (method_exists($conn, 'executeStatement')) { + $conn->executeStatement($sql); + } else { + $conn->exec($sql); + } } private function getDriver(): string diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index e7a669a711..2d4b9bd673 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -126,7 +126,7 @@ class Connection 'available_at' => '?', ]); - $this->executeUpdate($queryBuilder->getSQL(), [ + $this->executeStatement($queryBuilder->getSQL(), [ $body, json_encode($headers), $this->configuration['queue_name'], @@ -179,7 +179,7 @@ class Connection ->set('delivered_at', '?') ->where('id = ?'); $now = new \DateTime(); - $this->executeUpdate($queryBuilder->getSQL(), [ + $this->executeStatement($queryBuilder->getSQL(), [ $now, $doctrineEnvelope['id'], ], [ @@ -329,10 +329,14 @@ class Connection return $stmt; } - private function executeUpdate(string $sql, array $parameters = [], array $types = []) + private function executeStatement(string $sql, array $parameters = [], array $types = []) { try { - $stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types); + if (method_exists($this->driverConnection, 'executeStatement')) { + $stmt = $this->driverConnection->executeStatement($sql, $parameters, $types); + } else { + $stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types); + } } catch (TableNotFoundException $e) { if ($this->driverConnection->isTransactionActive()) { throw $e; @@ -342,7 +346,11 @@ class Connection if ($this->autoSetup) { $this->setup(); } - $stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types); + if (method_exists($this->driverConnection, 'executeStatement')) { + $stmt = $this->driverConnection->executeStatement($sql, $parameters, $types); + } else { + $stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types); + } } return $stmt;