Skip to content

Commit

Permalink
Fix updating null language variables
Browse files Browse the repository at this point in the history
  • Loading branch information
afbora committed Aug 17, 2024
1 parent 4d3213f commit c2170dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cms/LanguageVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ public function key(): string
/**
* Sets a new value for the language variable
*/
public function update(string $value): static
public function update(string|null $value = null): static
{
$translations = $this->language->translations();
$translations[$this->key] = $value;
$translations = $this->language->translations();
$translations[$this->key] = $value ?? '';

$language = $this->language->update(['translations' => $translations]);

Expand Down

0 comments on commit c2170dd

Please sign in to comment.