Skip to content

Commit 552a556

Browse files
committed
fix(auth): default public_profile_allow_chat_with_me to true for new users
Aligns the User entity constructor and Doctrine column mapping so both agree with the 2023 migration's DB-level default (1/true), closing the code/DB contradiction flagged in ClickUp 86bbdxzt6. Previously the constructor set false while the DB default was already 1, so new accounts silently diverged from the intended on-by-default chat setting once any code path relied on the DB default instead of the explicit ORM insert. Adds a unit test asserting a freshly constructed User defaults to chat-allowed true.
1 parent c1e2ba0 commit 552a556

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

app/libs/Auth/Models/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class User extends BaseEntity
109109
/**
110110
* @var bool
111111
*/
112-
#[ORM\Column(name: 'public_profile_allow_chat_with_me', options: ['default' => 0], type: 'boolean')]
112+
#[ORM\Column(name: 'public_profile_allow_chat_with_me', options: ['default' => 1], type: 'boolean')]
113113
private $public_profile_allow_chat_with_me;
114114

115115
/**
@@ -464,7 +464,7 @@ public function __construct()
464464
$this->public_profile_show_social_media_info = false;
465465
$this->public_profile_show_bio = true;
466466
$this->public_profile_show_telephone_number = false;
467-
$this->public_profile_allow_chat_with_me = false;
467+
$this->public_profile_allow_chat_with_me = true;
468468

469469
$this->password = "";
470470
$this->identifier = null;

tests/unit/UserMappingTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
*/
3030
class UserMappingTest extends BrowserKitTestCase
3131
{
32+
public function testDefaultPublicProfileAllowChatWithMeIsTrue()
33+
{
34+
$user = new User();
35+
$this->assertTrue($user->isPublicProfileAllowChatWithMe());
36+
}
37+
3238
public function testUserPersistence()
3339
{
3440
$email = 'test@nomail.com';

0 commit comments

Comments
 (0)