Problem/Motivation
Intend to fix #3275851: [META] Fix PHP 8.2 dynamic property deprecations
Proposed resolution
aggregate of
- #3311383: Apply #[\AllowDynamicProperties] attribute to core classes to allow contrib has less noise in logs
- #3309745: Fix dynamic property deprecations and other unit test failures for PHP 8.2
- #3309748: Define missing object properties on non-testing classes for PHP 8.2
- #3311562: Set sqlQuery in Entity\Query\Sql Condition classes on own class
done
- #2839195: Add a method to access the original property (not needed)
- #3298396: Upgrade composer requirement to 2.3.6 to prevent warnings on PHP 8.2 (needs work for release notes only, has been comitted)
- #3298731: Using ConstraintViolation::$arrayPropertyPath bugs on PHP 8.2
- #3308744: Fix magic connection property access from \Drupal\Core\FileTransfer\FileTransfer::__get()
- #3274474: Fix 'Access to an undefined property' PHPStan L0 errors
- #2531564: Fix leaky and brittle container serialization solution
- #3298906: Fix \Drupal\Tests\Core\Test\TestSetupTraitTest::testChangeDatabasePrefix() on PHP 8.2
- #3298199: Upgrade phpstan/phpstan to 1.8.2 for support of PHP 8.2 #[\AllowDynamicProperties] attribute - required to use #[\AllowDynamicProperties]
- #3295813: ViewsEntitySchemaSubscriber access undefined property of View
- #3299853: Apply #[\AllowDynamicProperties] attribute to base classes to make PHP 8.2 log size sane
- #3299327: Replace deprecated static::method() calls for PHP 8.2
- #3298923: Fix ProtectedUserFieldConstraintValidatorTest to not trigger deprecations on PHP 8.2
- [#]
Remaining tasks
close when parent issue fixed
| Comment | File | Size | Author |
|---|---|---|---|
| #122 | 3295821-122-9-meta.patch | 31.91 KB | andypost |
| #122 | interdiff.txt | 578 bytes | andypost |
| #121 | 3295821-121-9-meta.patch | 31.73 KB | andypost |
| #121 | interdiff.txt | 565 bytes | andypost |
Comments
Comment #2
andypostComment #3
andypostComment #4
andypostComment #5
andypostadded #2839195-63: Add a method to access the original property
Comment #6
andypostComment #7
andypostComment #8
andypost2,581 failed
Comment #9
andypostAdded
- #3274474: Fix 'Access to an undefined property' PHPStan L0 errors
- #3298396: Upgrade composer requirement to 2.3.6 to prevent warnings on PHP 8.2
- #3298343: upgrade egulias/email-validator to 3.2.1 to support PHP 8.2
2,205 failed
Comment #10
andypostthis should fix lots of tests, probably needs new issue
1,907 failed
Comment #11
andyposta bit more properties
1,796 failed
Comment #12
andypostmore migration tests will pass
Comment #13
andypostFix ConfigurationTest and BlockHtmlTest (weird public property
\Drupal\Core\Session\UserSession::$sessionId)Comment #14
andypostfix #12
Comment #15
andypoststub phpcs
1,680 failed
Comment #16
andypostremove
modules/views_ui/src/ViewUI.php.orig1,680 failures
Comment #17
andypostfir remaining callables and
core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.phpComment #18
andypostone more undefined property
Comment #19
andypostFix CS for #17
Comment #20
andypost1,445. Failed
Comment #21
andypostSetting
#[AllowDynamicProperties]onConfigEntityBase948 failed
Comment #22
andypost\Drupal\views\Plugin\views\PluginBasegot annotation940 failed
Comment #23
andypostMore fixes for views
Comment #24
andypost416 failed
Comment #25
andypostLots of errors because
sounds like needs drupal-wrapper class to use custom property
Comment #26
andypostAnother strange runs
-
-
Comment #27
andypostFix mostly all rest and content translation tests
Comment #28
andypostFix CS
Few tests fail with similar
mocks needs separate issue
Comment #29
andypostfix CS again
Comment #30
andypost223 failed
Comment #31
andypostStill not clear what todo with constraints
186 failed
Comment #32
andypostFix few more test
Lots of migrations are fails because of
Tricky one
\Drupal\Tests\views\Kernel\ModuleTest::testLoadFunctions()162 failed
Comment #33
andypostone more callable to make
\Drupal\Tests\views\Kernel\ModuleTest::testLoadFunctions()pass168
Comment #34
andypostadded #3204929-15: Html::load() inconsistent space removal with old libxml2 versions. and #3298199-3: Upgrade phpstan/phpstan to 1.8.2 for support of PHP 8.2 #[\AllowDynamicProperties] attribute
162
Comment #35
andypostAdded #3298821: Remove test that tests drupal/core-composer-scaffold when it is not allowed
looks random 167 failed
Comment #36
andypostUsing #3298821-9: Remove test that tests drupal/core-composer-scaffold when it is not allowed
Comment #37
andypostinterdiff vs #34
162 failed
Comment #38
andypostComment #39
andypostFixed
\Drupal\Tests\Core\Test\TestSetupTraitTest- needs new issue162
Comment #40
andypostAdded #3298731-6: Using ConstraintViolation::$arrayPropertyPath bugs on PHP 8.2 as workaround and fix CS as #39
125 fails
Comment #41
andypostField_layout.Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTestvs
Media_library.Drupal\Tests\media_library\FunctionalJavascript\WidgetOEmbedTestfails randomly
Comment #42
andypostUsing #3298821-11: Remove test that tests drupal/core-composer-scaffold when it is not allowed
126
Comment #43
andypostFiled #3298923: Fix ProtectedUserFieldConstraintValidatorTest to not trigger deprecations on PHP 8.2
and one more property for View
Comment #44
andypostFix CS
127
Comment #45
andypostone more fix for mocks
122
Comment #46
andypostanother mock
121
Comment #47
andypostupgrade of https://github.com/sirbrillig/phpcs-variable-analysis/releases/tag/v2.11.4 and clean-up patch
Comment #48
andypostpick latest patch from #2531564-197: Fix leaky and brittle container serialization solution
Comment #49
andypostre-roll and fix on release https://github.com/bovigo/vfsStream/releases/tag/v1.6.11-alpha.0
116 fails
Comment #50
andypost2 less
116 fails
following fails randomaly
Comment #51
andypostre-roll
Comment #52
andypostcheck only composer updates
2,993 failed
Comment #53
andypostpatch with composer and annotations
2,976 failed
Comment #54
andypostComment #55
andypost- https://github.com/bovigo/vfsStream/releases/tag/v1.6.11-alpha.0 is required to pass
ViewsEntitySchemaSubscriberIntegrationTestComment #56
andypostWithout stable release the branch will fail as we have a test for required stability <=1
Comment #57
andypostComment #58
andypostre-roll after #3298343: upgrade egulias/email-validator to 3.2.1 to support PHP 8.2
2,993
Comment #59
andypostComment #60
andypostAdded #3299327: Replace deprecated static::method() calls for PHP 8.2
Comment #61
andypostComment #62
andypostupgrade of
mglaman/phpstan-drupalComment #63
andypostre-roll #51 - 116 fails
Comment #64
andypostre-roll after composer deps are done #3295520: Update dependencies for Drupal 10.0 and 9.5
112 failed
Comment #65
andypostre-roll after #3298923: Fix ProtectedUserFieldConstraintValidatorTest to not trigger deprecations on PHP 8.2
110 failed
Comment #66
andypostFixed #3299853: Apply #[\AllowDynamicProperties] attribute to base classes to make PHP 8.2 log size sane
so removed clean-up
Comment #67
andypostComment #68
andypostNeeds reroll
Comment #69
andypost109 failed
Comment #70
andypostAdded #3299828: Stop storing Settings singleton in object properties
Comment #71
andypostUsing #3299828-30: Stop storing Settings singleton in object properties
Comment #72
andypostthe patch
Comment #73
andypostre-roll after commit of #3298906: Fix \Drupal\Tests\Core\Test\TestSetupTraitTest::testChangeDatabasePrefix() on PHP 8.2 with #3299828: Stop storing Settings singleton in object properties
23 failed
Comment #74
andypostwithout settings-addition
Comment #75
andypost24 failed
Comment #76
andypostComment #77
andypost2 fixed tests
Comment #78
andypostComment #79
andypostre-roll
Comment #80
andypostFiled #3308744: Fix magic connection property access from \Drupal\Core\FileTransfer\FileTransfer::__get()
Comment #81
andypostComment #82
andypostfix CS
Comment #83
andypost#3308744-3: Fix magic connection property access from \Drupal\Core\FileTransfer\FileTransfer::__get()
Comment #84
andypost20 failed
Comment #85
andypostre-roll after #2531564: Fix leaky and brittle container serialization solution
Comment #86
andypostComment #87
andypostcommited #3274474: Fix 'Access to an undefined property' PHPStan L0 errors
1906 fails
Comment #88
andypostThere's more fixes then 3 issues in summary
Rebased changes and replaced patch #24 with #48 from #3298731: Using ConstraintViolation::$arrayPropertyPath bugs on PHP 8.2
Comment #89
andypostAdded missing 2 files, interdiff vs #87
20 fails
Comment #90
andypostLet's see how it went without #2839195: Add a method to access the original property
829 fails
Comment #91
berdirthe tests failed because you didn't remove this part, this property no longer exists.
you can remove this as well.
this too. anything that's on entity classes should be safe to drop. You could post it as an interdiff in a new issue, because we want to clean it up at some point, but it doesn't need to be here and now.
do we need an issue for these remaining mock changes?
this can be removed too for now.
this also needs an issue?
this needs to be investigated.
I'm not sure what's this about, what exactly are we testing here? could we just drop this now that we changed the container serialzation thing?
Comment #92
berdirTry adding this as a workaround, that fixes Drupal\Tests\Core\UrlTest.
Comment #93
andypostThank you, fixed #91.1 and gonna file new issues for other points
23 failed
Comment #94
andypostUsing #92
Comment #95
andypostRe #91 filed 3 issues
2/3/5/7) filed #3309748: Define missing object properties on non-testing classes for PHP 8.2
4) #3309745: Fix dynamic property deprecations and other unit test failures for PHP 8.2
6) #3309750: Fix callable syntax for PHP 8.2 in Views.php
8) we need to define the property to prevent following errors but when I define property with underscore then sniffers does not pass
So I defined property without underscore and changed usage of old one to new
Comment #96
andypostThe remaining 17 failures mostly caused by
Comment #97
berdirAs suggested in slack, try adding #[\AllowDynamicProperties] to \Drupal\Component\Plugin\Definition\PluginDefinition as a workaround, but we should also create a separate issue to unserialize all installed entity types and remove that property from them if they have it, but we can't do that without having that property in place for now.
Comment #98
andypostfix unserialize, not clear where
$label_callbackand others from interdiff are usedre-rolled after #3298731: Using ConstraintViolation::$arrayPropertyPath bugs on PHP 8.2
Comment #100
andypostWorkaround from #92
Comment #101
bbralaDrush cr on is
Comment #102
bbralaComment #103
andypost\Drupal\views\ViewExecutable::$live_previewneeds more work, wanna see how many tests will failComment #104
andypostAttempt to use attribute
Comment #105
berdirI need to double-check because I'm not 100% sure I got it right. My proposal is not to remove the changes that you did, but remove the test entirely. Based on my understanding, this is a left-over of #2531564: Fix leaky and brittle container serialization solution. It's testing that we can set undefined properties. changing it to test setting defined properties is not the same thing, the point is that we no longer need this ability and we should no longer test it.
Comment #106
andypostMoved fixes for #92
- 2-3 to #3299857-3: [PP-1] Remove AllowDynamicProperties attribute from ConfigEntityBase (interdiff with this changes removed)
- 4,5,8 #3309745-3: Fix dynamic property deprecations and other unit test failures for PHP 8.2
- 7 #3309748-3: Define missing object properties on non-testing classes for PHP 8.2
Comment #107
andypostlet's see if User entity allows extra property
Comment #108
andypostComment #109
andypostSo #92.3 is required
Comment #110
andypostComment #111
andypost- #3309745-9: Fix dynamic property deprecations and other unit test failures for PHP 8.2
and
- #3309748-11: Define missing object properties on non-testing classes for PHP 8.2
Comment #112
andypostOther way to fix "sqlQuery"
Comment #113
andypostone more mock (and remaining 8 failures are passed with patched PHP for parse_url)
Comment #114
andypostused #3311562: Set sqlQuery in Entity\Query\Sql Condition classes on own class
Comment #115
andyposttest for 9.5
2803 failed
Comment #116
andypostnor clear why 9.5.x is so different
631 failed
Comment #117
berdirI think a few things weren't backported. #3274474: Fix 'Access to an undefined property' PHPStan L0 errors was for example, but only a part of it, we're missing a lot of that now.
Comment #118
andypostone more fix
Comment #119
andypost9.5 only 73 failed
Comment #120
andypostThe most common is
2x: Creation of dynamic property GuzzleHttp\Psr7\MultipartStream::$stream is deprecatedComment #121
andypostFix bit more tests 63 failed
Comment #122
andypostand backport of one more fix
Comment #123
andypostno longer needed, now there's children under #3275851: [META] Fix PHP 8.2 dynamic property deprecations