Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Damien McKenna <[email protected]>
  • Loading branch information
MPParsley and damienmckenna authored Jul 27, 2020
1 parent b4be10f commit 9cc2202
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions og.module
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ function og_entity_access(EntityInterface $entity, $operation, AccountInterface
if (count($audience_fields) === 1) {
$field_definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type_id, $bundle_id);
foreach ($field_definitions as $field_definition) {

/** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
if (!in_array($field_definition->getName(), array_keys($audience_fields))) {
continue;
Expand Down Expand Up @@ -248,7 +247,7 @@ function og_entity_create_access(AccountInterface $account, array $context, $bun
$handler = \Drupal::service('plugin.manager.entity_reference_selection');
$handler = $handler->getInstance($options);

// @todo: remove deprecated call to Og::getSelectionHandler.
// @todo Remove deprecated call to Og::getSelectionHandler.
$handler = Og::getSelectionHandler($field_definition);

if ($handler && $handler->countReferenceableEntities()) {
Expand Down Expand Up @@ -347,7 +346,6 @@ function og_field_widget_info_alter(array &$info) {
* be rebuilt via RouteBuilder::setRebuildNeeded.
*/
function og_entity_type_alter(array &$entity_types) {

/** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
foreach ($entity_types as $entity_type_id => $entity_type) {

Expand Down
3 changes: 1 addition & 2 deletions src/Plugin/EntityReferenceSelection/OgSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
}

if (empty($this->configuration['entity'])) {
// @todo: Find out why we have this scenario.
// @todo Find out why we have this scenario.
return $query;
}

Expand Down Expand Up @@ -222,7 +222,6 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
$bundles_info = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id);

if ($entity_type->hasKey('bundle')) {

$bundles = Og::groupTypeManager()->getGroupBundlesByEntityType($entity_type_id);
foreach ($bundles as $bundle) {
$bundle_options[$bundle] = $bundles_info[$bundle]['label'];
Expand Down
3 changes: 1 addition & 2 deletions tests/src/Functional/OgSelectionWidgetOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class OgSelectionWidgetOptionsTest extends BrowserTestBase {
*/
protected $group2;


/**
* An unpublished group node.
*
Expand Down Expand Up @@ -162,7 +161,7 @@ public function testNonRequiredAudienceField() {
$this->drupalGet('node/add/group_content');
// The user can't post group content site wide so the audience is required
// field.
// todo: is that correct?
// todo Is that correct?
// $this->assertSession()->optionExists('Groups audience', '_none');.
$this->assertSession()->optionExists('Groups audience', $this->group1->label());
$this->assertSession()->optionNotExists('Groups audience', $this->group2->label());
Expand Down

0 comments on commit 9cc2202

Please sign in to comment.