Skip to content

Commit

Permalink
Merge pull request #1786 from bolt/bugfix/dont-cache-slug-uses
Browse files Browse the repository at this point in the history
Avoid caching slug uses definition for new records
  • Loading branch information
bobdenotter authored Aug 27, 2020
2 parents ef7bda3 + 6ef97b6 commit 2e5d166
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/Entity/Field/SlugField.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Bolt\Entity\Field;
use Bolt\Entity\FieldInterface;
use Doctrine\ORM\Mapping as ORM;
use Tightenco\Collect\Support\Collection;

/**
* @ORM\Entity
Expand All @@ -33,9 +32,4 @@ public function setValue($value): parent

return $this;
}

public function getSlugUseFields(): array
{
return Collection::wrap($this->getDefinition()->get('uses'))->toArray();
}
}
2 changes: 1 addition & 1 deletion templates/_partials/fields/slug.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:field-class='{{ class|json_encode }}'
:required='{{ required|json_encode }}'
:readonly='{{ readonly|json_encode }}'
:generate='{{ field.slugUseFields|join(',')|json_encode }}'
:generate='{{ field.definition.uses|join(',')|json_encode }}'
:errormessage='{{ errormessage|json_encode }}'
:pattern='{{ pattern|json_encode }}'
:labels='{{ {
Expand Down

0 comments on commit 2e5d166

Please sign in to comment.