Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
ISAICP-6027: Fix deprecated warning: Passing an account object is dep…
Browse files Browse the repository at this point in the history
…recated.

Deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1.
See Gizra/og#542.
  • Loading branch information
pfrenssen committed Jun 9, 2020
1 parent d24534c commit bba1e45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ public function validateForm(array &$form, FormStateInterface $form_state): void
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state): void {
$user = $this->currentUser();
$user_id = $this->currentUser()->id();

$membership = $this->membershipManager->getMembership($this->collection, $user);
$membership = $this->membershipManager->getMembership($this->collection, $user_id);
$membership->delete();

// Also remove the user authorship, if case.
if ($this->collection->getOwnerId() === $user->id()) {
if ($this->collection->getOwnerId() === $user_id) {
$this->collection->skip_notification = TRUE;
$this->collection->setOwnerId(0)->save();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,10 @@ public function access(RdfInterface $rdf_entity): AccessResultInterface {
* The membership of the user or null.
*/
protected function getUserNonBlockedMembership(RdfInterface $collection): ?OgMembershipInterface {
$membership = $this->membershipManager->getMembership($collection, $this->getUser(), [
return $this->membershipManager->getMembership($collection, $this->getUser()->id(), [
OgMembershipInterface::STATE_ACTIVE,
OgMembershipInterface::STATE_PENDING,
]);
return $membership;
}

/**
Expand Down

0 comments on commit bba1e45

Please sign in to comment.