FriendsOfSymfony1 / symfony1

[DEPRECATED -- Use Symfony instead] Fork of symfony 1.4 with DIC, form enhancements, latest Swiftmailer, better performance, composer compatible and PHP 8 support
https://symfony.com/legacy
MIT License
338 stars 176 forks source link

Fix PHP8.1 sfForm - Unsupported operand types: array + null on sfForm #281

Closed Tybaze closed 8 months ago

Tybaze commented 1 year ago

Fix PHP8.1 sfForm - Unsupported operand types: array + null on sfForm::updateValues()

Avoid error : Fatal error: Uncaught TypeError: Unsupported operand types: array + null in lib\form\sfForm.class.php:319

Step to reproduce : $form = new sfForm(); $form->updateValues(array('foo' => 'value'));

PHP 5.3 coding style

May use sfForm::getValues(), but as sfForm::updateValues() is a hack, it could be used before bind ($this->isBound = true);

thePanz commented 9 months ago

@Tybaze I updated this PR according to the comments (and rebased on the latest master branch) Let me know if this fixes the error on your side and can be merged