Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After #2225353: Convert $form_state to an object and provide methods like setError() goes in, start in on removing the array usage of FormState
Comments
Comment #1
tim.plunkettComment #2
tim.plunkettComment #3
tim.plunkettComment #4
jibranWhy you moved it
8.0.x-dev
to8.1.x-dev
?Comment #5
tim.plunkettBecause there's no way we're holding beta up on this, and there are 2006 usages of 107 unique form_state keys. We can remove all of the *usages* of the magic [] syntax in core, but we can just remove the ArrayAccess code itself later.
Comment #6
XanoComment #7
catchThat still doesn't need to be 8.1.x - if we'd make a change in 8.1.x, then we should be prepared to make it at any point up until an RC of 8.0.0 (except for large new features which are likely to add release blocking tasks/bugs once committed).
How's this?
Comment #8
tim.plunkettFine by me. #2316533: Add getValue/setValue/hasValue and isValueEmpty to FormState removes ~1000 usages of form_state['values'], we can make good progress on this if the issues keep going in.
Comment #9
xjmComment #10
tim.plunkett#2332389: Finish adding methods to FormStateInterface should add the remaining methods needed.
Comment #11
xjmWe ready to tear the bandaid off then?
Comment #12
tim.plunkett#2335659: Remove FormState ArrayAccess usage from core currently contains the entirety of the conversion. It's 259K, and could be split into a 106K views and 153K non-views patch... But then they'd have to go in a specific order.
Comment #13
tim.plunkettBoth child issues are in! Thanks everyone.