Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks #27382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

krixon
Copy link

@krixon krixon commented May 25, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27378
License MIT

Fixes the issue described in #27378

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone May 25, 2018
@nicolas-grekas nicolas-grekas changed the title Fix #27378: Error when rendering a DateIntervalType form with exactly… [Form] Error when rendering a DateIntervalType form with exactly 0 weeks Jun 15, 2018
@nicolas-grekas nicolas-grekas changed the title [Form] Error when rendering a DateIntervalType form with exactly 0 weeks [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks Jun 15, 2018
@nicolas-grekas
Copy link
Member

Note that 3.2 is not maintained anymore so that this should be merged on 3.4 (or 2.8 if the issue exists there. Does it?)

@nicolas-grekas
Copy link
Member

(please check tests and CS failures also)

@krixon krixon force-pushed the dateinterval-array-transformer branch from 9ab0b48 to dae704a Compare June 18, 2018 12:03
@krixon krixon changed the base branch from 3.2 to 3.4 June 18, 2018 12:05
@krixon
Copy link
Author

krixon commented Jun 18, 2018

Note that 3.2 is not maintained anymore so that this should be merged on 3.4 (or 2.8 if the issue exists there. Does it?)

Thanks, I've rebased onto 3.4 and updated the PR target accordingly. The problem does not exist in 2.8.

please check tests and CS failures also

I am still seeing some test failures locally, however I see the same failures on the 3.4 branch itself - they are unrelated to my changes. I've included details of these errors below. I am also not sure why AppVeyor thinks it can't build this branch - could you advise on how to proceed please?

1) Symfony\Component\Ldap\Tests\AdapterTest::testLdapQuery
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php:40

2) Symfony\Component\Ldap\Tests\AdapterTest::testLdapQueryIterator
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php:60

3) Symfony\Component\Ldap\Tests\AdapterTest::testLdapQueryScopeBase
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php:86

4) Symfony\Component\Ldap\Tests\AdapterTest::testLdapQueryScopeOneLevel
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php:102

5) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapAddAndRemove
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

6) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapAddInvalidEntry
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

7) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapUpdate
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

8) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapUnboundAdd
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

9) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapUnboundRemove
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

10) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapUnboundUpdate
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

11) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapRename
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

12) Symfony\Component\Ldap\Tests\LdapManagerTest::testLdapRenameWithoutRemovingOldRdn
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php:31

13) Symfony\Component\Ldap\Tests\LdapClientTest::testLdapClientFunctional
Symfony\Component\Ldap\Exception\ConnectionException: Can't contact LDAP server

/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php:54
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Ldap.php:38
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/LdapClient.php:39
/home/karl/code/krixon/symfony/src/Symfony/Component/Ldap/Tests/LdapClientTest.php:165

--

There were 4 failures:

1) Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testNoClassFromNsSeparatorId
Failed asserting that exception message 'The definition for "\foo" has no class attribute, and appears to reference a class or interface in the global namespace. Leaving out the "class" attribute is only allowed for namespaced classes. Please specify the class attribute explicitly to get rid of this error.' contains 'The definition for "\foo" has no class.'.

2) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testConstructorWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'

/home/karl/code/krixon/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php:46

3) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testStaticCreateWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'

/home/karl/code/krixon/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php:134

4) Symfony\Component\HttpFoundation\Tests\ResponseFunctionalTest::testCookie with data set #0 ('cookie_max_age')
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
-Warning: Expiry date cannot have a year greater than 9999 in %scookie_max_age.php on line 10
+Fatal error: Uncaught Error: Class 'PHPUnit\Util\ErrorHandler' not found in /home/karl/code/krixon/symfony/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:290
+Stack trace:
+#0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler::Symfony\Bridge\PhpUnit\{closure}(2, 'Expiry date can...', '/home/karl.rixo...', 10, Array)
+#1 /home/karl/code/krixon/symfony/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/cookie_max_age.php(10): setcookie('foo2', 'bar', 253402310800, '/')
+#2 {main}
+  thrown in /home/karl/code/krixon/symfony/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php on line 290
@@ @@
-    [3] => Set-Cookie: foo=bar; expires=Sat, 01-Jan-10000 02:46:40 GMT; Max-Age=%d; path=/
+    [3] => Set-Cookie: foo=bar; expires=Sat, 01-Jan-10000 02:46:40 GMT; Max-Age=251872986908; path=/

/home/karl/code/krixon/symfony/src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php:49

@nicolas-grekas
Copy link
Member

Thank you @krixon.

@nicolas-grekas nicolas-grekas merged commit dae704a into symfony:3.4 Jun 19, 2018
nicolas-grekas added a commit that referenced this pull request Jun 19, 2018
…th exactly 0 weeks (krixon)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27378
| License       | MIT

Fixes the issue described in #27378

Commits
-------

dae704a Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
@krixon krixon deleted the dateinterval-array-transformer branch June 19, 2018 16:19
This was referenced Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants