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

Ui test fix #1

Open
wants to merge 133 commits into
base: 8.x-1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
a1332bb
Fix config import
MPParsley Dec 5, 2018
4575144
Update test matrix.
pfrenssen Dec 11, 2018
4788729
Replace drupal_set_message() with the Messenger service.
pfrenssen Dec 11, 2018
07df1f5
Declare minimum version compatibility for Drupal core.
pfrenssen Dec 11, 2018
556eb67
Merge pull request #447 from Gizra/update-test-matrix
amitaibu Dec 11, 2018
5a4c222
Use cache api to store the group relation map
MPParsley Dec 11, 2018
dc20d01
Clarify how to work with all membership states.
pfrenssen Dec 11, 2018
ae3d367
Fix Travis CI Integration
webflo Nov 19, 2018
ec10371
Dump the composer log
webflo Nov 19, 2018
2230fab
Disable all deprecations
webflo Nov 19, 2018
04349ac
Test Drupal 8.7.x with PHP 7.2 only
webflo Nov 19, 2018
c1fe123
Sort excludes similar to env.matrix
webflo Nov 19, 2018
99dd5a0
Remove SYMFONY_DEPRECATIONS_HELPER again
webflo Nov 19, 2018
66bf8c0
Remove verbose flags from composer
webflo Nov 19, 2018
afceeaa
Revert Matrix change
webflo Dec 11, 2018
73ae911
Rename the constant to `ALL_STATES`.
pfrenssen Dec 12, 2018
c18e558
Merge pull request #437 from ueberbit/travis-ci
pfrenssen Dec 12, 2018
b37caed
Merge pull request #449 from Gizra/all-states
amitaibu Dec 12, 2018
65c95a8
Avoid double caching of OgMembership entities.
pfrenssen Dec 11, 2018
b54a74e
Merge pull request #446 from Gizra/avoid-double-caching
amitaibu Dec 13, 2018
7df64cb
Provide a method to retrieve group memberships by role.
pfrenssen Dec 11, 2018
5bd6f87
Avoid needlessly invoking EntityStorageInterface::loadMultiple().
pfrenssen Dec 12, 2018
8205988
Use the best fitting assertion for comparing array sizes.
brummbar Dec 18, 2018
dcb1bca
Merge pull request #451 from Gizra/get-group-memberships-by-roles
amitaibu Dec 19, 2018
b3de607
Merge pull request #13 from Gizra/8.x-1.x
MPParsley Dec 20, 2018
ff5f382
Use state service.
MPParsley Dec 20, 2018
c14520e
Fixed tests
MPParsley Dec 20, 2018
0058f69
Fixed tests
MPParsley Dec 20, 2018
79d3077
Merge pull request #14 from Gizra/8.x-1.x
MPParsley Dec 21, 2018
69df866
Added early exit
MPParsley Dec 21, 2018
2cb601c
Issue #455 - Early exit if no memberships to process
xurizaemon Dec 24, 2018
78c5313
Merge pull request #456 from xurizaemon/8.x-1.x-455_update_8001_no_me…
amitaibu Dec 24, 2018
940b6c9
Show uid in LogicException for existing membership
xurizaemon Jan 7, 2019
6302d0a
Merge pull request #458 from xurizaemon/8.x-1.x-existing_membership_e…
amitaibu Jan 8, 2019
480ca7a
Fix minor typo.
jbrauer Jan 12, 2019
a244dc5
Update src/Form/GroupSubscribeForm.php
MPParsley Jan 13, 2019
29055ee
Add default access check
pebosi Feb 1, 2019
5729c4d
Merge pull request #462 from pebosi/patch-1
amitaibu Feb 15, 2019
0bed4e9
Update views.view.og_members_overview.yml
MPParsley Mar 12, 2019
604822f
Use full pager on member overview
MPParsley Mar 14, 2019
ca79e89
Retrieve the bundle directly from the membership.
pfrenssen Mar 20, 2019
170d479
Fix tests
MPParsley Mar 20, 2019
a8c8e0d
Merge pull request #468 from Gizra/get-bundle-from-membership
MPParsley Mar 20, 2019
f811b7d
Merge pull request #467 from Gizra/feature/members-overview-full-pager
amitaibu Apr 16, 2019
e8d32cb
Merge pull request #465 from Gizra/464-fix-broken-handler
amitaibu Apr 16, 2019
4d5e921
Update OgGroupContentOperationAccessTest.php
MPParsley Apr 18, 2019
1506df0
Update SelectionHandlerTest.php
MPParsley Apr 18, 2019
790640c
Update tests/src/Kernel/Entity/SelectionHandlerTest.php
MPParsley Apr 18, 2019
5f550c0
Update tests/src/Kernel/Entity/SelectionHandlerTest.php
MPParsley Apr 19, 2019
c5da003
Update tests/src/Kernel/Access/OgGroupContentOperationAccessTest.php
amitaibu Apr 21, 2019
38a1ae3
Document technical debt.
pfrenssen Apr 22, 2019
05dab44
Use gender neutral language in documentation.
pfrenssen Apr 22, 2019
0f488cf
Require tests to pass on Drupal 8.7. Add experimental testing on Drup…
pfrenssen Apr 22, 2019
2e74edd
Drupal 8.7 requires a field name to be present when creating a comment.
pfrenssen Apr 22, 2019
68cc709
Declare which properties are intended to be exported for membership t…
pfrenssen Apr 22, 2019
9d76e0c
Trying to install invalid schemas for the System module has been depr…
pfrenssen Apr 22, 2019
5d4278d
The `context` annotation has been deprecated in favor of `context_def…
pfrenssen Apr 22, 2019
4ca9ec7
Use newer versions of deprecated classes and traits.
pfrenssen Apr 22, 2019
67cdc11
Allow to use release candidates for testing.
pfrenssen Apr 22, 2019
2ca16a2
Merge pull request #473 from Gizra/support-drupal-8.7.x
pfrenssen Apr 23, 2019
8734254
Merge remote-tracking branch 'origin/8.x-1.x' into feature/8.7_cs_fixes
pfrenssen Apr 23, 2019
b718715
Merge pull request #450 from MPParsley/patch-2
pfrenssen Apr 23, 2019
eccd5b4
Merge pull request #471 from Gizra/feature/8.7_cs_fixes
pfrenssen Apr 23, 2019
9a92d8d
Merge pull request #461 from jbrauer/bugs/join_group_typo
pfrenssen Apr 23, 2019
13a989d
Provide a method to retrieve the membership IDs of a given group filt…
pfrenssen Apr 23, 2019
7fd066e
Update views.view.og_members_overview.yml
MPParsley Apr 23, 2019
8997552
Apply suggestions from code review
MPParsley Apr 23, 2019
85a76b6
433 Remove deprecated setting for use_queue
MPParsley Apr 23, 2019
3eb359c
Merge pull request #476 from Gizra/feature/474_fix_permission
pfrenssen Apr 23, 2019
97f03b6
Merge pull request #478 from Gizra/feature/433_remove_use_queue
pfrenssen Apr 23, 2019
950190c
Merge pull request #475 from Gizra/getGroupMembershipIdsByRoleNames
pfrenssen Apr 23, 2019
872cbfa
Merge pull request #443 from MPParsley/patch-1
pfrenssen Apr 23, 2019
ce40341
fix plugin not found exception during kernel tests
DiDebru Nov 16, 2018
7b8845b
Adds basic UI for adding, editing and removing group memberships
jludwig Jan 11, 2017
9c01614
Adds a bit of polish to the membership UI: including adding operation…
jludwig Jan 30, 2017
c4781e8
Adds PR #222 since they work well together and this avoids merge conf…
jludwig Jan 30, 2017
03772c8
Adds membership type page to facilitate when multiple membership type…
jludwig Feb 1, 2017
147b4c9
Ensures that only valid members/roles can be selected. Also some misc…
jludwig Feb 4, 2017
b0046be
Adds a general membership add page for when multiple membership types…
jludwig Feb 11, 2017
272863c
OG membership UI code cleanup etc based on PR review feedback
jludwig May 12, 2017
bdb22b2
Additional OG membership UI tweaks and fixes.
jludwig May 13, 2017
0ebb8f5
OG Membership UI: Fixes PluginNotFoundException in tests.
jludwig Jun 1, 2017
b1421b9
API update: getUser() to getOwner().
jludwig Oct 16, 2017
2c5d94f
Credit: zerolab | OgAdminRoutesEvent array merge fix. Important param…
jludwig Nov 3, 2017
a270ce6
Fixed entity reference selection plugin loading all membership entiti…
joachim-n May 29, 2018
d456eb7
Added method to MembershipManager to get the count of members in a gr…
joachim-n May 29, 2018
f757bb1
Fixed access check to query for the count of group members, rather th…
joachim-n May 29, 2018
e4bc034
Added docs to UniqueOgMembershipConstraintValidator to explain why it…
joachim-n May 29, 2018
361851c
Fixed UniqueOgMembershipConstraintValidator loading all membership en…
joachim-n May 29, 2018
5932bad
Removed getGroupMemberships(): no longer used, and does not scale for…
joachim-n May 29, 2018
4b7cdae
Fix OgUserSelection query
zerolab Jun 8, 2018
e136d8d
Fix query
zerolab Jun 8, 2018
204b802
fixup! Fix query
zerolab Jun 8, 2018
c15a9fc
Fix UniqueOgMembershipConstraintValidator not filtering on the group
zerolab Aug 31, 2018
36f2f0e
use new fieldtype
DiDebru Nov 16, 2018
01c4e69
fix php doc
DiDebru Nov 16, 2018
ddd003a
fix fatal on group create
DiDebru Nov 16, 2018
0f86fd1
add options module to all kernel tests
DiDebru Nov 19, 2018
4f084d0
Remove t() from setLabel()
DiDebru Nov 19, 2018
dd2e1c2
test
DiDebru Nov 19, 2018
2ddb841
Remove deprecated drupal_set_message replace it with OO MessengerInte…
DiDebru Nov 19, 2018
dc15112
add cache_test
DiDebru Nov 19, 2018
2862839
add messenger to test
DiDebru Nov 19, 2018
970b20f
fix typo
DiDebru Nov 19, 2018
0161078
fix code style
DiDebru Nov 19, 2018
4be862d
Add field module to BundleFormAlter
DiDebru Nov 19, 2018
686e5fa
fix code style
DiDebru Nov 19, 2018
c89c4ad
Revert "Remove t() from setLabel()"
DiDebru Nov 19, 2018
f4df10b
use entitymanager for backport compability
DiDebru Nov 19, 2018
7da3623
Revert "use entitymanager for backport compability"
DiDebru Nov 19, 2018
1d2f4bc
Fix typos
DiDebru Nov 21, 2018
c270e45
Remove installSchema()
DiDebru Nov 26, 2018
75e9a31
Revert "Remove installSchema()"
DiDebru Nov 26, 2018
eff799a
Fix deprecated installSchema
DiDebru Nov 26, 2018
e39ee62
Comment name cant be null
DiDebru Nov 26, 2018
91c54f1
Remove invalid schema
DiDebru Nov 27, 2018
73ad188
Add t() to setLabel in og.module:287
DiDebru Nov 27, 2018
ffd6d92
Add missing getGroupMemberships() function
DiDebru Nov 29, 2018
a74e063
Add use statement
DiDebru Nov 29, 2018
88eb203
Use Messeangertrait in GroupUnsubscribeForm
DiDebru Nov 29, 2018
373d10a
FetchAllAssoc getGroupMemberships()
DiDebru Nov 30, 2018
7c8c46e
Fix CreateMembershipTest
DiDebru Nov 30, 2018
d6067bc
fix code style
DiDebru Nov 30, 2018
075675f
Provide better DX for getGroupMemberships function
DiDebru Dec 4, 2018
39ab610
#441 - recommended change by MPParsley
DiDebru Dec 5, 2018
8c946cd
Remove unused use statement
DiDebru Dec 6, 2018
cadd15d
Fix undefined index
DiDebru Dec 10, 2018
115a459
Remove redundant use statement
DiDebru Jan 3, 2019
721a25f
Remove redundant messanger var
DiDebru Jan 3, 2019
2615039
Fix GroupCheck Fatal on custom routes
DiDebru Feb 4, 2019
92cc901
Fix fatal error
DiDebru Feb 5, 2019
e3bff7a
Fix Exception on config import
DiDebru Feb 12, 2019
7ec3778
#49713 workaround cache problem in phpunittest
zuernBernhard Sep 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@ language: php
sudo: true

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

env:
global:
- COMPOSER_MEMORY_LIMIT=2G
matrix:
- TEST_SUITE=8.5.x
- TEST_SUITE=8.6.x
- TEST_SUITE=8.7.x
- TEST_SUITE=8.8.x
- TEST_SUITE=PHP_CodeSniffer

# Only run the coding standards check once.
matrix:
exclude:
- php: 5.6
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.0
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.1
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.2
env: TEST_SUITE=PHP_CodeSniffer
allow_failures:
- env: TEST_SUITE=8.6.x
- env: TEST_SUITE=8.8.x

mysql:
database: og
Expand All @@ -44,9 +41,6 @@ before_script:
# Remember the current directory for later use in the Drupal installation.
- MODULE_DIR=$(pwd)

# Install Composer dependencies for OG.
- composer install

# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"source": "https://cgit.drupalcode.org/og"
},
"require": {
"drupal/core": "~8.5"
"drupal/core": "~8.7"
},
"require-dev": {
"drupal/coder": "~8.2"
}
},
"minimum-stability": "RC"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,17 @@ content:
rows: 2
placeholder: ''
third_party_settings: { }
roles:
type: options_buttons
weight: 0
settings: { }
third_party_settings: { }
uid:
type: og_autocomplete
weight: -1
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ content:
og_membership_request:
label: above
type: basic_string
weight: 0
weight: 2
settings: { }
third_party_settings: { }
roles:
type: entity_reference_label
weight: 1
label: above
settings:
link: false
third_party_settings: { }
uid:
type: entity_reference_label
weight: 0
label: above
settings:
link: true
third_party_settings: { }
hidden: { }
76 changes: 66 additions & 10 deletions config/optional/views.view.og_members_overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status: true
dependencies:
module:
- og
- options
- user
_core:
default_config_hash: RnChWtrF4u0Q13iQMFypL0Uz6IsB4NY6ZTk_LorSbJg
Expand All @@ -22,8 +23,9 @@ display:
position: 0
display_options:
access:
type: none
options: { }
type: perm
options:
perm: 'access user profiles'
cache:
type: none
options: { }
Expand All @@ -46,12 +48,17 @@ display:
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
type: full
options:
items_per_page: 10
items_per_page: 50
offset: 0
id: 0
total_pages: null
tags:
previous: ‹‹
next: ››
first: '« First'
last: 'Last »'
expose:
items_per_page: false
items_per_page_label: 'Items per page'
Expand All @@ -60,9 +67,7 @@ display:
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
quantity: 9
style:
type: table
options:
Expand Down Expand Up @@ -356,10 +361,10 @@ display:
entity_type: og_membership
entity_field: state
plugin_id: field
roles:
id: roles
roles_target_id:
id: roles_target_id
table: og_membership__roles
field: roles
field: roles_target_id
relationship: none
group_type: group
admin_label: ''
Expand Down Expand Up @@ -421,6 +426,57 @@ display:
entity_type: og_membership
entity_field: roles
plugin_id: field
operations:
id: operations
table: og_membership
field: operations
relationship: none
group_type: group
admin_label: ''
label: 'Operations links'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
destination: true
entity_type: og_membership
plugin_id: entity_operations
filters: { }
sorts: { }
header: { }
Expand Down
15 changes: 15 additions & 0 deletions config/schema/og.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,18 @@ condition.plugin.og_group_type:
type: sequence
sequence:
type: string

# Copied and adapted from core.entity.schema.yml
field.widget.settings.og_autocomplete:
type: mapping
label: 'OG context based entity reference autocomplete with display format settings'
mapping:
match_operator:
type: string
label: 'Autocomplete matching'
size:
type: integer
label: 'Size of textfield'
placeholder:
type: label
label: 'Placeholder'
7 changes: 6 additions & 1 deletion og.install
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ function og_update_8001(&$sandbox) {
\Drupal::entityDefinitionUpdateManager()->installFieldStorageDefinition('entity_bundle', 'og_membership', 'og', $storage_definition);

$sandbox['#finished'] = 0;
$sandbox['batch_size'] = 500;
$sandbox['current'] = 0;
$sandbox['total'] = $storage->getQuery()->count()->execute();
$sandbox['batch_size'] = 500;

if (!$sandbox['total']) {
$sandbox['#finished'] = 1;
return t('No OG memberships found.');
}
}

// Update the existing memberships to include the group bundle ID.
Expand Down
8 changes: 8 additions & 0 deletions og.links.action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
og_membership.add:
deriver: \Drupal\og\Plugin\Derivative\OgActionLink

og_membership.type_add:
route_name: og_membership.type_add
title: 'Add membership type'
appears_on:
- entity.og_membership_type.collection
5 changes: 5 additions & 0 deletions og.links.menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
entity.og_membership_type.collection:
title: 'Membership types'
parent: system.admin_structure
description: 'Create and manage fields, forms, and display settings for OG memberships.'
route_name: entity.og_membership_type.collection
13 changes: 13 additions & 0 deletions og.links.task.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
og.og_admin_routes:
deriver: \Drupal\og\Plugin\Derivative\OgLocalTask
entity.og_membership.canonical:
route_name: entity.og_membership.canonical
base_route: entity.og_membership.canonical
title: View
entity.og_membership.edit_form:
route_name: entity.og_membership.edit_form
base_route: entity.og_membership.canonical
title: Edit
entity.og_membership.delete_form:
route_name: entity.og_membership.delete_form
base_route: entity.og_membership.canonical
title: Delete
weight: 10
53 changes: 48 additions & 5 deletions og.module
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use Drupal\og\Entity\OgRole;
use Drupal\og\Og;
use Drupal\og\OgGroupAudienceHelperInterface;
use Drupal\og\OgMembershipInterface;
use Drupal\og\OgMembershipTypeInterface;
use Drupal\og\OgRoleInterface;
use Drupal\system\Entity\Action;
use Drupal\user\EntityOwnerInterface;
Expand Down Expand Up @@ -53,11 +54,7 @@ function og_entity_insert(EntityInterface $entity) {

// Other modules that implement hook_entity_insert() might already have
// created a membership ahead of us.
if (!Og::getMembership($entity, $entity->getOwner(), [
OgMembershipInterface::STATE_ACTIVE,
OgMembershipInterface::STATE_PENDING,
OgMembershipInterface::STATE_BLOCKED,
])) {
if (!Og::getMembership($entity, $entity->getOwner(), OgMembershipInterface::ALL_STATES)) {
$membership = Og::createMembership($entity, $entity->getOwner());
$membership->save();
}
Expand Down Expand Up @@ -177,6 +174,47 @@ function og_entity_access(EntityInterface $entity, $operation, AccountInterface
return AccessResult::forbidden();
}

/**
* Implements hook_ENTITY_TYPE_access().
*/
function og_og_membership_type_access(OgMembershipTypeInterface $entity, $operation, AccountInterface $account) {
// Do not allow deleting the default membership type.
if ($operation === 'delete' && $entity->id() === OgMembershipInterface::TYPE_DEFAULT) {
return AccessResult::forbidden();
}

// If the user has permission to administer all groups, allow access.
if ($account->hasPermission('administer group')) {
return AccessResult::allowed();
}

return AccessResult::forbidden();
}

/**
* Implements hook_ENTITY_TYPE_access().
*/
function og_og_membership_access(OgMembershipInterface $entity, $operation, AccountInterface $account) {
$group = $entity->getGroup();

// If there's a group owner, don't let them leave.
if (
isset($group_fields['uid'])
&& $operation === 'delete'
&& $group_fields['uid']->entity->id() === $entity->getOwner()->id()
) {
return AccessResult::forbidden();
}

// Ensure that there's at least one member in the group.
if ($operation === 'delete' && \Drupal::service('og.membership_manager')->getGroupMembershipCount($group) === 1) {
return AccessResult::forbidden();
}

return \Drupal::service('og.access')
->userAccess($entity->getGroup(), 'manage members');
}

/**
* Implements hook_entity_create_access().
*/
Expand Down Expand Up @@ -378,6 +416,11 @@ function og_og_role_insert(OgRoleInterface $role) {
return;
}

// Do not create config while config import is in progress.
if (\Drupal::isConfigSyncing()) {
return;
}

$add_id = 'og_membership_add_single_role_action.' . $role->getName();
if (!Action::load($add_id)) {
$action = Action::create([
Expand Down
Loading