Boljsi msg za revizije, dodan avtor spremembe

pull/59/head
Jurij Podgoršek 2024-04-11 20:16:06 +02:00
parent 98f6e751e7
commit 769d6ef1e4
3 changed files with 3 additions and 5 deletions

View File

@ -14,6 +14,6 @@ site_mail: false
emails: '' emails: ''
subject: '[YUFU] New draft [node:title]' subject: '[YUFU] New draft [node:title]'
body: body:
value: "New draft pedning moderation: [node:title] ([node:nid]) by [node:author:email].\r\n\r\n[node:url]\r\n\r\n[node:body]" value: "New draft pending moderation: [node:title] ([node:nid]) by [node:author:mail].\r\n\r\n[node:url]/revisions/view/[node:original:vid]/[node:vid]/visual_inline\r\n\r\n[node:body]"
format: plain_text format: plain_text
label: 'Nov osnutek' label: 'Nov osnutek'

View File

@ -8,7 +8,6 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\TypedData\Exception\MissingDataException; use Drupal\Core\TypedData\Exception\MissingDataException;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\rest\Plugin\ResourceBase; use Drupal\rest\Plugin\ResourceBase;
// use Drupal\rest\ResourceResponse;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
@ -101,7 +100,7 @@ class AddConcept extends ResourceBase {
* @param \Symfony\Component\HttpFoundation\Request; * @param \Symfony\Component\HttpFoundation\Request;
* Post request. * Post request.
* *
* @return \Drupal\rest\ResourceResponse * @return \Symfony\Component\HttpFoundation\JsonResponse
* Returns rest resource. * Returns rest resource.
*/ */
public function post(Request $request) { public function post(Request $request) {
@ -168,7 +167,6 @@ class AddConcept extends ResourceBase {
'revision_uid' => $concept->getRevisionUserId(), 'revision_uid' => $concept->getRevisionUserId(),
'uid' => $concept->uid->target_id, 'uid' => $concept->uid->target_id,
]; ];
// $response = new ResourceResponse($response_status);
$response = new JsonResponse($response_status); $response = new JsonResponse($response_status);
return $response; return $response;
} }

View File

@ -12,7 +12,7 @@ use Drupal\node\NodeInterface;
/** /**
* Implements hook_entity_update(). * Implements hook_entity_update().
*/ */
function yufu_admin_node_presave(EntityInterface $entity) { function yufu_concept_node_presave(EntityInterface $entity) {
//function yufu_concept_entity_update(EntityInterface $entity) { //function yufu_concept_entity_update(EntityInterface $entity) {
if ($entity instanceOf NodeInterface && $entity->bundle() == 'concept') { if ($entity instanceOf NodeInterface && $entity->bundle() == 'concept') {
$transition = \Drupal::service('content_moderation_notifications.notification_information')->getTransition($entity); $transition = \Drupal::service('content_moderation_notifications.notification_information')->getTransition($entity);