-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
… support all rdf_entity routes.
if ($member->getEntityTypeId() == 'user') { | ||
$membership->setUser($member->id()); | ||
} | ||
$membership->save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works for users. This has recently changed. All entity types other than users now use field storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but this method does that exactly. Checks a user membership.
Also it is defined as such: @given (the following )user memberships:
*/ | ||
public function __construct(array $configuration, $plugin_id, $plugin_definition) { | ||
parent::__construct($configuration, $plugin_id, $plugin_definition); | ||
$this->currentRouteMatch = \Drupal::routeMatch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't inject the routematcher in a block and do direct checks on the route. That creates a hard coupling between the block and the route. If we ever change the route then this doesn't work any more.
Drupal has the concept of Contexts for this. We already have a context to retrieve the collection from the route: \Drupal\collection\ContextProvider\CollectionRouteContext
. Let's use this instead.
…not about RDF entities in general.
… with collections. Better BDD.
…ted. Custom pages are not depending on memberships at the moment.
…rship to be more in line of BDD principles.
…nodes. Otherwise they cannot create published nodes.
…ication state to TRUE.
No description provided.