Skip to content

Commit

Permalink
Release v4.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette authored Jul 1, 2022
2 parents 91d43fd + 774bc45 commit 12f0ff7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.3', '7.4', '8.0']
php_versions: ['7.3', '7.4', '8.0', '8.1']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - MySQL
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.3', '7.4', '8.0']
php_versions: ['7.3', '7.4', '8.0', '8.1']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - SQLite
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.3', '7.4', '8.0']
php_versions: ['7.3', '7.4', '8.0', '8.1']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - PostgreSQL
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.3', '7.4', '8.0']
php_versions: ['7.3', '7.4', '8.0', '8.1']

runs-on: windows-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - Windows
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v4.6.5](https://github.com/userfrosting/UserFrosting/compare/v4.6.4...v4.6.5)

### Fix
- Fix for FindUniqueTest when class mappings are changed ([#1201](https://github.com/userfrosting/UserFrosting/pull/1201))
- Allowing no default group on register ([#1202](https://github.com/userfrosting/UserFrosting/pull/1202))
- Allow Composer plugin by default
- Add PHP 8.1 version to test suite

## [v4.6.4](https://github.com/userfrosting/UserFrosting/compare/v4.6.3...v4.6.4)

### Fix
Expand Down
21 changes: 13 additions & 8 deletions app/sprinkles/account/src/Account/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,22 @@ public function register()
// Validate the userdata
$this->validate();

// Set default group
$defaultGroup = $this->ci->classMapper->getClassMapping('group')::where('slug', $this->defaultGroup)->first();
if ($this->defaultGroup) {
// Set default group using the configuration "site.registration.user_defaults.group"
$defaultGroup = $this->ci->classMapper->getClassMapping('group')::where('slug', $this->defaultGroup)->first();

if (!$defaultGroup) {
$e = new HttpException("Account registration is not working because the default group '{$this->defaultGroup}' does not exist.");
$e->addUserMessage('ACCOUNT.REGISTRATION_BROKEN');
if (!$defaultGroup) {
$e = new HttpException("Account registration is not working because the default group '{$this->defaultGroup}' does not exist.");
$e->addUserMessage('ACCOUNT.REGISTRATION_BROKEN');

throw $e;
}
throw $e;
}

$this->setUserProperty('group_id', $defaultGroup->id);
$this->setUserProperty('group_id', $defaultGroup->id);
} else {
// Users default to not being in a group on registration (configuration value === null)
$this->setUserProperty('group_id', null);
}

// Hash password
$this->hashPassword();
Expand Down
3 changes: 3 additions & 0 deletions app/sprinkles/account/tests/Integration/FindUniqueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function setUp(): void
// Setup test database
$this->setupTestDatabase();
$this->refreshDatabase();

$this->ci->classMapper->setClassMapping('user', 'UserFrosting\Sprinkle\Account\Database\Models\User');
$this->ci->classMapper->setClassMapping('group', 'UserFrosting\Sprinkle\Account\Database\Models\Group');
}

/**
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
}
],
"config": {
"vendor-dir": "app/vendor"
"vendor-dir": "app/vendor",
"allow-plugins": {
"composer/installers": true,
"wikimedia/composer-merge-plugin": true
}
},
"require": {
"php": "^7.3 | ^8.0",
Expand Down

0 comments on commit 12f0ff7

Please sign in to comment.