Commit b2de4763 authored by Samuel Mortenson's avatar Samuel Mortenson Committed by Sam Mortenson
Browse files

Issue #3327008 by samuel.mortenson: Drupal 10 support

parent d73258d8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -506,7 +506,7 @@
      }

      if (Drupal.quickedit && Drupal.quickedit.collections.entities) {
        $('body').once('moderation-note-quickedit').each(function () {
        once('moderation-note-quickedit', 'body').each(function () {
          // Toggle moderation note visibility based on Quick Edit's status.
          Drupal.quickedit.collections.entities.on('change:isActive', function (model, is_active) {
            if (is_active) {
@@ -539,7 +539,7 @@
      });

      // Auto-open a note, if applicable.
      $('body').once('moderation-note-open').each(function () {
      once('moderation-note-open', 'body').each(function () {
        if (typeof URLSearchParams !== 'undefined') {
          var query = new URLSearchParams(location.search);
          if (query.has('open-moderation-note')) {
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ name: Moderation Note
type: module
description: Provides the ability to notate elements of a moderated Entity.
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
package: Other
configure: moderation_note.settings
dependencies:
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@ main:
      css/moderation_note.css: {}
  dependencies:
    - core/drupal.dialog.off_canvas
    - core/jquery.once
    - core/once
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ function moderation_note_entity_delete(EntityInterface $entity) {
  if ($entity instanceof ModerationNoteInterface) {
    // Load and delete all child notes for this parent.
    $ids = \Drupal::entityQuery('moderation_note')
      ->accessCheck(FALSE)
      ->condition('parent', $entity->id())
      ->execute();
    $notes = \Drupal::entityTypeManager()->getStorage('moderation_note')->loadMultiple($ids);
@@ -52,6 +53,7 @@ function moderation_note_entity_delete(EntityInterface $entity) {
  else {
    // Load and delete all associated notes for this entity.
    $ids = \Drupal::entityQuery('moderation_note')
      ->accessCheck(FALSE)
      ->condition('entity_type', $entity->getEntityTypeId())
      ->condition('entity_id', $entity->id())
      ->execute();
@@ -200,6 +202,7 @@ function _moderation_note_attach_field_notes(array &$variables) {

  // Load notes for this entity field.
  $ids = \Drupal::entityQuery('moderation_note')
    ->accessCheck(FALSE)
    ->condition('entity_type', $entity->getEntityTypeId())
    ->condition('entity_id', $entity->id())
    ->condition('entity_field_name', $element['#field_name'])
+2 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ class ModerationNoteController extends ControllerBase {
    $build = [];

    $ids = $this->entityTypeManager()->getStorage('moderation_note')->getQuery()
      ->accessCheck(FALSE)
      ->condition('entity_type', $entity->getEntityTypeId())
      ->condition('entity_id', $entity->id())
      ->condition('entity_langcode', $this->languageManager()->getCurrentLanguage()->getId())
@@ -155,6 +156,7 @@ class ModerationNoteController extends ControllerBase {
    $build = [];

    $ids = $this->entityTypeManager()->getStorage('moderation_note')->getQuery()
      ->accessCheck(FALSE)
      ->condition('assignee', $user->id())
      ->condition('published', 1)
      ->execute();
Loading