Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HistoryLogger missing STATUS_PROPERTY check on log update skip #40

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
CHANGELOG for 1.x
===================
## v1.11.0 - (2024-09-19)
### Added
`CreatableTrait` Trait & interface with creation date
`MonthYearTrait` Trait & interface with numeric representation of a month and his numeric year. Useful for statistics purposes.

### Changed
`README.md` update : Add missing nelmio security settings configuration (@lfortunier)

### Fixed
- `HistoryLogger` add missing STATUS_PROPERTY check on **log** update skip
- `NameableInterface::setName` add missing null case as it is mentioned on the trait
- `NameableTrait::name` property scope set as protected
- `PersonNameableTrait::getInitial` use mb_substr for string with first accentuated character

## v1.10.0 - (2024-08-28)
### Added
- `ArrayUtils::hasDuplicateValue` + tests (@lfortunier)
Expand Down
3 changes: 0 additions & 3 deletions CHANGELOG_add_trait_monthelable_and_created.md

This file was deleted.

2 changes: 0 additions & 2 deletions CHANGELOG_update_nelmio_security_doc.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/Entity/NameableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ interface NameableInterface
{
public function getName(): ?string;

public function setName(string $name): self;
public function setName(?string $name): self;
}
2 changes: 1 addition & 1 deletion src/Entity/NameableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait NameableTrait
#[ORM\Column(length: 255)]
#[Assert\Length(max: 255)]
#[Assert\NotBlank]
private ?string $name = null;
protected ?string $name = null;

public function getName(): ?string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/PersonNameableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function getInitial(): string
{
return sprintf(
'%s%s',
substr(trim($this->getFirstName()), 0, 1),
substr(trim($this->getLastName()), 0, 1)
mb_substr(trim($this->getFirstName()), 0, 1),
mb_substr(trim($this->getLastName()), 0, 1)
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Logger/HistoryLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function log(HistorizableInterface $entity, ?string $code = null, array $
if (
$code === self::UPDATED_CODE
&& !isset($history[self::DIFF_PROPERTY])
&& !isset($history[self::STATUS_PROPERTY])
&& $this->title === null
&& $this->comment === null
&& $this->description === null
Expand Down