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

Merge release 3.3.1 into 3.4.x #747

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,25 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 3.3.1 - 2024-03-04


-----

### Release Notes for [3.3.1](https://github.com/nucleos/NucleosUserBundle/milestone/37)

3.3.x bugfix release (patch)

### 3.3.1

- Total issues resolved: **0**
- Total pull requests resolved: **1**
- Total contributors: **1**

#### Bug

- [746: Revert: Fix roles doctrine type mapping](https://github.com/nucleos/NucleosUserBundle/pull/746) thanks to @core23

## 3.3.0 - 2024-03-04


Expand All @@ -21,6 +40,25 @@ Feature release (minor)

- [745: Fix roles doctrine type mapping](https://github.com/nucleos/NucleosUserBundle/pull/745) thanks to @core23

## 3.2.1 - 2024-02-07


-----

### Release Notes for [3.2.1](https://github.com/nucleos/NucleosUserBundle/milestone/34)

3.2.x bugfix release (patch)

### 3.2.1

- Total issues resolved: **0**
- Total pull requests resolved: **1**
- Total contributors: **1**

#### Bug

- [742: Fix doctrine listener registration](https://github.com/nucleos/NucleosUserBundle/pull/742) thanks to @core23

## 3.2.0 - 2024-02-04


Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -79,6 +79,7 @@
"symfony/yaml": "^6.4 || ^7.0"
},
"conflict": {
"doctrine/dbal": ">=4",
"doctrine/doctrine-bundle": "<1.12",
"doctrine/mongodb": "<1.6",
"doctrine/mongodb-odm": "<1.1",
Expand Down
18 changes: 15 additions & 3 deletions src/DependencyInjection/NucleosUserExtension.php
Expand Up @@ -13,6 +13,7 @@

namespace Nucleos\UserBundle\DependencyInjection;

use Doctrine\ORM\Events;
use Nucleos\UserBundle\Mailer\ResettingMailer;
use Nucleos\UserBundle\Model\GroupManager;
use Nucleos\UserBundle\Model\UserManager;
Expand All @@ -35,11 +36,19 @@ final class NucleosUserExtension extends Extension implements PrependExtensionIn
private static array $doctrineDrivers = [
'orm' => [
'registry' => 'doctrine',
'tag' => 'doctrine.event_subscriber',
'tag' => 'doctrine.event_listener',
'events' => [
Events::prePersist,
Events::preUpdate,
],
],
'mongodb' => [
'registry' => 'doctrine_mongodb',
'tag' => 'doctrine_mongodb.odm.event_subscriber',
'tag' => 'doctrine_mongodb.odm.event_listener',
'events' => [
Events::prePersist,
Events::preUpdate,
],
],
];

Expand Down Expand Up @@ -94,10 +103,13 @@ public function load(array $configs, ContainerBuilder $container): void

if ($config['use_listener'] && isset(self::$doctrineDrivers[$config['db_driver']])) {
$listenerDefinition = $container->getDefinition('nucleos_user.user_listener');
$listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag']);
if (isset(self::$doctrineDrivers[$config['db_driver']]['listener_class'])) {
$listenerDefinition->setClass(self::$doctrineDrivers[$config['db_driver']]['listener_class']);
}

foreach (self::$doctrineDrivers[$config['db_driver']]['events'] as $event) {
$listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag'], ['event' => $event]);
}
}

$this->remapParametersNamespaces($config, $container, [
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine-mapping/Group.orm.xml
Expand Up @@ -2,6 +2,6 @@
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Nucleos\UserBundle\Model\Group">
<field name="name" column="name" type="string" length="180" unique="true"/>
<field name="roles" column="roles" type="json"/>
<field name="roles" column="roles" type="array"/>
</mapped-superclass>
</doctrine-mapping>
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine-mapping/User.orm.xml
Expand Up @@ -10,6 +10,6 @@
<field name="passwordRequestedAt" column="password_requested_at" type="datetime" nullable="true"/>
<field name="locale" type="string" column="locale" length="8" nullable="true"/>
<field name="timezone" type="string" column="timezone" length="64" nullable="true"/>
<field name="roles" column="roles" type="json"/>
<field name="roles" column="roles" type="array"/>
</mapped-superclass>
</doctrine-mapping>