Bump plugin version so the us_invites schema migration actually runs
CI / Tests (PHP 8.2) (pull_request) Successful in 37s
CI / Tests (PHP 8.1) (pull_request) Successful in 44s
CI / No Debug Code (pull_request) Successful in 2s
CI / Coding Standards (pull_request) Successful in 2m55s
CI / PHPStan (pull_request) Successful in 2m54s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m36s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.2) (pull_request) Successful in 37s
CI / Tests (PHP 8.1) (pull_request) Successful in 44s
CI / No Debug Code (pull_request) Successful in 2s
CI / Coding Standards (pull_request) Successful in 2m55s
CI / PHPStan (pull_request) Successful in 2m54s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m36s
CI / Build Plugin Zip (pull_request) Skipped
PR #83 added kind and expires_at to us_invites and the repository started writing them, but USC_VERSION stayed at 1.0.0-rc.2 — Plugin::boot() only re-runs Installer/dbDelta on a version mismatch, so upgraded sites never got the columns. Every invite insert then failed silently: nothing appeared under Pending Invites while the admin was still shown a registration link whose token hash was never stored. - Version / USC_VERSION -> 1.0.0-rc.3 (triggers dbDelta on next load). - InviteRepository::insert() returns 0 on failure instead of a stale insert_id, and the Invites page now shows an error notice instead of a dead link when creation fails (personal and group forms), including clearer validation messages. - CLAUDE.md: schema changes must bump the version. Closes #87 Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -11,8 +11,12 @@ class InviteRepository {
|
||||
$this->table = $db->prefix . 'us_invites';
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist an invite. Returns the new row id, or 0 when the insert failed —
|
||||
* callers must not hand out a registration link for an unstored token.
|
||||
*/
|
||||
public function insert( Invite $invite ): int {
|
||||
$this->db->insert(
|
||||
$result = $this->db->insert(
|
||||
$this->table,
|
||||
[
|
||||
'email' => $invite->email,
|
||||
@@ -29,7 +33,7 @@ class InviteRepository {
|
||||
[ '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s' ]
|
||||
);
|
||||
|
||||
return $this->db->insert_id;
|
||||
return false === $result ? 0 : $this->db->insert_id;
|
||||
}
|
||||
|
||||
public function findByToken( string $token ): ?Invite {
|
||||
|
||||
Reference in New Issue
Block a user