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 Do not mark changed when setting value in constructor #11478

Merged
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
2 changes: 1 addition & 1 deletion src/ORM/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ public function classDescription(): ?string
public function i18n_classDescription(): ?string
{
$notDefined = 'NOT_DEFINED';
$description = _t(static::class.'.CLASS_DESCRIPTION', $this->classDescription() ?? $notDefined);
$description = _t(static::class . '.CLASS_DESCRIPTION', $this->classDescription() ?? $notDefined);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you mean "this fixes the linting issue"
I spent a good five minutes trying to figure out what the linting issue was with this, why CI was green, and why you were pointing it out rather than fixing it. Full sentences save time :p

if ($description === $notDefined) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/FieldType/DBField.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function __construct(?string $name = null, array $options = [])
}
// Setting value needs to happen below the call to setOptions() in case the default value is set there
$value = $this->getDefaultValue();
$this->setValue($value);
$this->setValue($value, markChanged: false);

parent::__construct();
}
Expand Down