Skip to content

Commit

Permalink
bugfix: clear password form field when existing entry does not have one
Browse files Browse the repository at this point in the history
bugfix - migration: hashed password column requires varchar 255
  • Loading branch information
Fabian Vetter committed Dec 6, 2020
1 parent 3e4c14e commit 05436e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Controller/ManageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public function update(Request $request)
$this->flashError($this->translator->trans('shared_project_timesheets.manage.persist.error'));
}
} else if ( !$form->isSubmitted() ) {
$form->get('password')->setData(ManageService::PASSWORD_DO_NOT_CHANGE_VALUE);
if ( !empty($sharedProject->getPassword()) ) {
$form->get('password')->setData(ManageService::PASSWORD_DO_NOT_CHANGE_VALUE);
}
}

return $this->render(
Expand Down
2 changes: 1 addition & 1 deletion Migrations/Version2020120600000.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function up(Schema $schema): void
$table->addColumn('id', Types::INTEGER, ['autoincrement' => true, 'notnull' => true]);
$table->addColumn('project_id', Types::INTEGER, ['notnull' => true]);
$table->addColumn('share_key', Types::STRING, ['length' => 20, 'notnull' => true]);
$table->addColumn('password', Types::STRING, ['length' => 50, 'default' => null, 'notnull' => false]);
$table->addColumn('password', Types::STRING, ['length' => 255, 'default' => null, 'notnull' => false]);
$table->addColumn('entry_user_visible', Types::BOOLEAN, ['default' => false, 'notnull' => true]);
$table->addColumn('entry_rate_visible', Types::BOOLEAN, ['default' => false, 'notnull' => true]);

Expand Down

0 comments on commit 05436e4

Please sign in to comment.