Skip to content

Subscribe and unsubscribe routes#268

Merged
amitaibu merged 119 commits into
8.x-1.xfrom
og-ui-subscribe-routes
Aug 5, 2016
Merged

Subscribe and unsubscribe routes#268
amitaibu merged 119 commits into
8.x-1.xfrom
og-ui-subscribe-routes

Conversation

@amitaibu

@amitaibu amitaibu commented Jul 26, 2016

Copy link
Copy Markdown
Owner

Restarting the great work from #59 , in a shared branch.

PR allows users to subscribe and unsubscribe from groups (group/node/1/subscribe and group/node/1/unsubscribe)

Comment thread og_ui/og_ui.routing.yml Outdated
requirements:
_permission: 'administer group'

og_ui.subscribe:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @dawehner and @damiankloip suggested in #59 (comment) , I'll move those routes and the access services to OG core.

Comment thread og.routing.yml
path: 'group/{entity_type_id}/{entity_id}/subscribe/{field_name}'
defaults:
_controller: '\Drupal\og\Controller\SubscriptionController::subscribe'
_title: 'Join Group'

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be a callback, as it will be 'Subscribe to group' or 'Request subscription to group` -- according to the group's permissions.

@amitaibu

Copy link
Copy Markdown
Owner Author

Update: I'm going to follow the pattern of node/add/{node_type}, as in fact subscribe is the OgMembership form with a few hidden fields.

@amitaibu

amitaibu commented Aug 3, 2016

Copy link
Copy Markdown
Owner Author

So, yet another issue found by this PR - we didn't add the member role whenever we did $memebership->getRoles() - so permissions might not have worked. I'll open a follow up to add more test coverage.

@amitaibu

amitaibu commented Aug 3, 2016

Copy link
Copy Markdown
Owner Author

The functional tests are in place.

I have moved the permissions from Og UI into OG core, since also the subscribe/ unsubscribe have moved to core itself -as they are such an import part of OG itself. @pfrenssen hope it's ok for you, otherwise let me know.

@amitaibu

amitaibu commented Aug 4, 2016

Copy link
Copy Markdown
Owner Author

Ready for review! 😄

@amitaibu

amitaibu commented Aug 4, 2016

Copy link
Copy Markdown
Owner Author

cc @pfrenssen

@pfrenssen

Copy link
Copy Markdown
Collaborator

Awesome work! I don't have time to review this today or this weekend unfortunately. I can take a look at this on Tuesday when I am at Drupalaton.

->setLabel(t('State'))
->setDescription(t("The state of the group content."))
->setDefaultValue(TRUE);
->setDefaultValue(OgMembershipInterface::STATE_ACTIVE);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I also stumbled upon this, this caused a failure in #217.

@amitaibu amitaibu merged commit 19675fb into 8.x-1.x Aug 5, 2016
@amitaibu amitaibu deleted the og-ui-subscribe-routes branch August 5, 2016 18:35
@amitaibu

amitaibu commented Aug 5, 2016

Copy link
Copy Markdown
Owner Author

In order not to stop development, I wanted ahead an got it in without a proper review. "Post mortem" review would still be appreciated :)

amitaibu added a commit that referenced this pull request May 28, 2017
A bundle should no longer be marked as a group type after it is deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants