Skip to content

Repository files navigation

Decidim::GroupUsers

This module restores some of the legacy User Groups functionality that was deprecated and removed in Decidim 0.31 (decidim/decidim#14130).

While Decidim core has migrated User Groups into regular participants with shared credentials, some usecases still rely on the ability for participants to act on behalf of a group when participating in the platform. This module brings back selected pieces of that functionality.

Comment as group

Restores the comment_as selector in the comment form, allowing verified participants to choose whether they want to post a comment as themselves or on behalf of a user group they belong to.

Installation

Add this line to your application's Gemfile:

gem "decidim-group_users", git: "git@github.com:mainio/decidim-module-group_users.git"

And then execute:

bundle install

Important: This module must be installed before running Decidim's database migrations. Decidim 0.32 ships migrations that permanently drop all user group tables and columns. If those migrations run first, user group data will be lost and cannot be recovered.

After copying migrations, run the neutralization task before migrating:

rails decidim:install:migrations
rails decidim_group_users:install:migrations
rails decidim_group_users:neutralize_user_group_migrations
rails db:migrate

The neutralization task rewrites the upstream removal migrations as no-ops so they are recorded as "run" without actually dropping any tables or columns.

Upgrading Decidim

When upgrading Decidim (e.g. from 0.31 to 0.32), follow this exact order:

  1. Update the Decidim version in your Gemfile
  2. Run bundle update decidim
  3. Copy new migrations: rails decidim:install:migrations
  4. Neutralize the removal migrations: rails decidim_group_users:neutralize_user_group_migrations
  5. Run migrations: rails db:migrate

Do not skip step 4. If rails db:migrate runs before neutralization, the user group tables will be dropped and all associated data will be permanently lost.

Usage

Once installed, the comment_as dropdown will reappear in comment forms across the platform. Participants who belong to a verified user group will be able to select that group when posting a comment, and the comment will be attributed accordingly.

No further configuration is required for the basic feature to work.

Compatibility

This module is intended for Decidim 0.31 and above, where the original User Groups feature has been removed from core.

Contributing

See Decidim's contributing guide.

License

This engine is distributed under the GNU Affero General Public License v3.0.

About

Partially recovers the UserGroup feature from previous versions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages