Skip to content

Commit

Permalink
Fix PHP8.1 sfForm - Unsupported operand types: array + null on sfForm…
Browse files Browse the repository at this point in the history
…::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);
  • Loading branch information
Tybaze committed Feb 14, 2023
1 parent 2c5a4d6 commit c8cadb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/form/sfForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function isBound()
*/
public function updateValues(array $values)
{
$this->values = $values + $this->values;
$this->values = $values + (isset($this->values) ? $this->values : array());

$this->updateValuesEmbeddedForms($values);
}
Expand Down

0 comments on commit c8cadb4

Please sign in to comment.