- Issue created by @joelpittet
- Assigned to Shreya_98
- @shreya_th opened merge request.
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 6:29am 20 October 2023 - 🇮🇳India Shreya_98
Hi @joelpittet,
I have fixed this issue and also created MR for this . kindly review the changes. - 🇨🇦Canada joelpittet Vancouver
@Shreya_th thanks that looks like it would solve my problem. The thing you may want to consider is that since this is Drupal 7 project it would be good to not push to a version of PHP without providing BC for older versions.
Good news is that this module already has a PHP 7.0 requirement so short array syntax is in play.
So my suggestion would be to leave the interface as it suggests you can do:
FormBase implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in require_once() (line 5 of form_builder/src/FormBase.php).
I think that means you could keep the interface as long as you implement the new methods. This is what they did in this patch for reference:
https://www.drupal.org/project/views_ajax_get/issues/3294688 🐛 Implements the Serializable interface, which is deprecated. RTBC - 🇨🇦Canada joelpittet Vancouver
#5 might also mean removing some of the typehints for params and return types
- Status changed to Needs work
about 1 year ago 10:12pm 20 October 2023 - 🇨🇦Canada joelpittet Vancouver
After testing the fix there is also these issues:
Warning: Undefined property: Drupal\form_builder_webform\Form::$elements in Drupal\form_builder_webform\Form->__serialize() (line 177 of form_builder/modules/webform/src/Form.php). Warning: Undefined property: Drupal\form_builder_webform\Form::$elementParents in Drupal\form_builder_webform\Form->__serialize() (line 178 of form_builder/modules/webform/src/Form.php). Warning: Undefined property: Drupal\form_builder_webform\Form::$elements in Drupal\form_builder_webform\Form->__serialize() (line 177 of form_builder/modules/webform/src/Form.php). Warning: Undefined property: Drupal\form_builder_webform\Form::$elementParents in Drupal\form_builder_webform\Form->__serialize() (line 178 of form_builder/modules/webform/src/Form.php).
Which seem to be related to the serialize changes.
- Status changed to Needs review
about 1 year ago 10:57pm 20 October 2023 - 🇨🇦Canada joelpittet Vancouver
I pushed the changes I proposed but left the type hinting as it was in 7.4 and should help with potential signature errors.
- Status changed to RTBC
about 1 year ago 11:37am 21 November 2023 - 🇩🇪Germany Anybody Porta Westfalica
Just ran into this with PHP 8.2. Thanks for the fixes @joelpittet and @Shreya_th!