Skip to content
Snippets Groups Projects

Automated Project Update Bot fixes

1 file
+ 7
7
Compare changes
  • Side-by-side
  • Inline
@@ -165,9 +165,9 @@ class MarkItController extends ControllerBase {
@@ -165,9 +165,9 @@ class MarkItController extends ControllerBase {
$markings = $this->markItManager->doMark($markit_type->id(), $entity, $this->currentUser(), $score, $markit);
$markings = $this->markItManager->doMark($markit_type->id(), $entity, $this->currentUser(), $score, $markit);
$this->moduleHandler()->alter('markit_' . $markit_type->id() . '_marked', $markings, $entity, $markit);
$this->moduleHandler()->alter('markit_' . $markit_type->id() . '_marked', $markings, $entity, $markit);
$this->lock->release($lock_cid);
$this->lock->release($lock_cid);
return JsonResponse::create($markings);
return new JsonResponse($markings);
}
}
return JsonResponse::create([], JsonResponse::HTTP_CONFLICT);
return new JsonResponse([], JsonResponse::HTTP_CONFLICT);
}
}
/**
/**
@@ -199,9 +199,9 @@ class MarkItController extends ControllerBase {
@@ -199,9 +199,9 @@ class MarkItController extends ControllerBase {
$markit = NULL;
$markit = NULL;
$markings = $this->markItManager->doUnmark($markit_type->id(), $entity, $this->currentUser(), $markit);
$markings = $this->markItManager->doUnmark($markit_type->id(), $entity, $this->currentUser(), $markit);
$this->moduleHandler()->alter('markit_' . $markit_type->id() . '_unmarked', $markings, $entity, $markit);
$this->moduleHandler()->alter('markit_' . $markit_type->id() . '_unmarked', $markings, $entity, $markit);
return JsonResponse::create($markings);
return new JsonResponse($markings);
}
}
return JsonResponse::create([], JsonResponse::HTTP_CONFLICT);
return new JsonResponse([], JsonResponse::HTTP_CONFLICT);
}
}
/**
/**
@@ -222,7 +222,7 @@ class MarkItController extends ControllerBase {
@@ -222,7 +222,7 @@ class MarkItController extends ControllerBase {
/** @var \Drupal\Core\Entity\EntityInterface $entity */
/** @var \Drupal\Core\Entity\EntityInterface $entity */
$entity = $this->entityTypeManager()->getStorage($entity_type)->load($id);
$entity = $this->entityTypeManager()->getStorage($entity_type)->load($id);
$markit_type_id = $markit_type ? $markit_type->id() : NULL;
$markit_type_id = $markit_type ? $markit_type->id() : NULL;
return JsonResponse::create($this->markItManager->getCountsOfEntity($entity, $markit_type_id));
return new JsonResponse($this->markItManager->getCountsOfEntity($entity, $markit_type_id));
}
}
/**
/**
@@ -254,9 +254,9 @@ class MarkItController extends ControllerBase {
@@ -254,9 +254,9 @@ class MarkItController extends ControllerBase {
foreach ($accounts as $account) {
foreach ($accounts as $account) {
$returned[] = \Drupal::service('serializer')->normalize($account, 'json');
$returned[] = \Drupal::service('serializer')->normalize($account, 'json');
}
}
return JsonResponse::create($returned);
return new JsonResponse($returned);
}
}
return JsonResponse::create($uids);
return new JsonResponse($uids);
}
}
}
}
Loading