Giter VIP home page Giter VIP logo

default-group's Introduction

Default Group by FriendsOfFlarum

License Latest Stable Version OpenCollective

A Flarum extension. Assign a default group to new users automatically.

screenshot

Installation

Install manually with composer:

composer require fof/default-group:"*"

Updating

composer update fof/default-group

Links

OpenCollective

An extension by FriendsOfFlarum.

default-group's People

Contributors

dependabot[bot] avatar dsevillamartin avatar flarum-bot avatar imorland avatar karaok491 avatar luceos avatar ralkage avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

default-group's Issues

Extension tries to add group multiple times

Bug Report

Current Behavior
Because of flarum/framework#2713, the Activated event runs multiple time. This extension always adds the group every time the event is dispatched without checking if the user already has the group.

Steps to Reproduce
I have not reproduced myself but the error has been seen here clarkwinkelmann/flarum-ext-passwordless#9

It should be reproducible by changing email and validating new email, or by logging in with the Passwordless extension.

It results in an error like Integrity constraint violation: 1062 Duplicate entry '1-6' for key 'PRIMARY' trying to re-insert the same group-user relationship.

Environment

  • Flarum version: 1.0.x

Possible solution(s)
We need to check whether the group is already added in https://github.com/FriendsOfFlarum/default-group/blob/master/src/Listeners/AddDefaultGroup.php

Even if the issue about duplicate event is fixed in Flarum, this is still a necessary fix in case a different extension would add the same group before this extension runs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.