Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 12 January 2024, 12 months ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue .

📌 Task
Status

Fixed

Version

1.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India sidharth_soman Bangalore

    The automated patch fixes all errors apart from:

    Value of core_version_requirement: ^8 || ^9 is not compatible with the next major version of Drupal core
    

    I have attached a patch to make the module entirely compatible now. Please review.

  • 🇬🇧United Kingdom rblake87
    /**
     * @file
     * Adds JS functionality to the Private Message Windows module.
     */
    
    /*global jQuery, Drupal, drupalSettings, window*/
    
    (function ($, Drupal, drupalSettings, window) {
      Drupal.PrivateMessageInbox = Drupal.PrivateMessageInbox || {};
    //  Drupal.PrivateMessageInbox.updateInbox = Drupal.PrivateMessageInbox.updateInbox || {};
    
      "use strict";
    
      var pmWindows, updateInterval, inboxRequesting, blockSettings;
      var requesting = { initedNeed: 1, thread: {}, threadRefresh: {}, msgSend: {}, newThread: 0, prevMsgsLoading: {}, userSearch: 0, threadDelete: {} };
      var winWidth = 260;
      var langPrefix = '';
    
      /**
       * Used to manually trigger Drupal's JavaScript commands.
       * @param {Object} data The data.
       */
      function triggerCommands(data) {
        var ajaxObject = Drupal.ajax({
          url: '',
          base: false,
          element: false,
          progress: false
        });
    
        // Trigger any ajax commands in the response.
        ajaxObject.success(data, 'success');
      }
    
      /**
       * Initializes the private message inbox window.
       */
      function init(context) {
        if(!requesting.initedNeed) return;
            var  block= $('.block-private-message-windows-block');
    
        var elements = once('overlay-block-ajax', '.block-private-message-windows-block');
        if(!block.length) { // block is still absent in the site DOM
          requesting.initedNeed++;
          setTimeout(function(){ init(context); }, 300);
          return;
        }
        requesting.initedNeed = 0;
    
    
        elements.forEach(function (element) {
          var displayWidth = $(document).width();
          if(displayWidth <= 600) {
            winWidth = Math.round(displayWidth*0.49);
          }else if(displayWidth <= 768) {
            winWidth = Math.round(displayWidth*0.32);
          }
    
          if(!drupalSettings.privateMessageWindowsBlock) return;
    
          blockSettings = drupalSettings.privateMessageWindowsBlock;
          langPrefix = blockSettings.currentLanguagePrefix;
    
          pmWindows = $(element).first().find('.block-content:first');
    
          var mainTitle = $(block).find('.main-title');
          mainTitle.find('.x').on('click touchstart', function () { pmWindows.hide(); return false; });
          mainTitle.find('.add-new').on('click touchstart', function () { $(block).find('.new-user-search').toggle(); return false; });
          mainTitle.after('<div class="new-user-search"><input placeholder="Type user name" /><div class="user-list"></div></div>');
    
          pmWindows.append('<style>' +
              '@-webkit-keyframes pmsgblink {' +
              '50% { color: ' + blockSettings.titleTextColor +
              '; } 51% { color: ' + blockSettings.titleNewMsgTextColor +
              '; } 100% { color: ' + blockSettings.titleNewMsgTextColor + '; }' +
            '} @keyframes pmsgblink {' +
              '50% { color: ' + blockSettings.titleTextColor +
              '; } 51% { color: ' + blockSettings.titleNewMsgTextColor +
              '; } 100% { color: ' + blockSettings.titleNewMsgTextColor + '; }' +
            '}' +
            '.block-private-message-windows-block .label { color: ' +
              blockSettings.titleTextColor +
              '; background-color: '+
              blockSettings.titleTextBackground +
            '; } .block-private-message-windows-block .block-content.new .label.main-title {' +
            '  color: ' + blockSettings.titleNewMsgTextColor + ';' +
            '  -webkit-animation: pmsgblink 2s linear infinite;' +
            '  animation: blink 2s pmsgblink infinite;' +
            '} </style>');
          if(newThreadCount()>0) {
            pmWindows.addClass('new');
          }else if(blockSettings.defaultHidden > 0) pmWindows.hide();
    
          updateInterval = blockSettings.ajaxRefreshRate * 1000;
          if (updateInterval) {
            window.setTimeout(loadUpdateInbox, updateInterval);
          }
    
          pmWindows.find('.inbox-thread-list .thread').on('click touchstart', inboxThreadLinkListenerHandler);
          pmWindows.find('.label').on('click touchstart', showHideWin);
    
          $('a[href*="/private-message/create?recipient="]').on('click touchstart', newRecipientMessage);
    
          $('a[href^="'+langPrefix+'/private-messages/"]').on('click touchstart', existsRecipientThread);
    
          $('a[href="'+langPrefix+'/private-messages"]').on('click touchstart', showMainWindow);
    
          pmWindows.find('.new-user-search input').on('input', getUserList4NewThread);
        });
      }
    
    
      /**
       * Show main window by click
       */
      function showMainWindow(e) {
        e.preventDefault();
        pmWindows.addClass('active');
        pmWindows.show();
      }
    
    
      /**
       * Show and hide inbox or thread window
       */
      function showHideWin() {
        $(this).parent().toggleClass('active');
      }
    
    
      /**
       * Request to delete the thread
       */
      function runDeleteThread() {
        var threadDiv = $(this).closest('.thread');
        var messagesDiv = threadDiv.find('.messages');
        if(messagesDiv.find('.request').length) return;
    
        messagesDiv.after('<div class="request"><div class="question">' + blockSettings['deleteThreadQuestion'] + '</div><div><div class="butt ok">OK</div><div class="butt cancel">Cancel</div></div><div class="note">' + blockSettings['deleteThreadNote'] + '</div></div>');
    
        threadDiv.find('.request .butt.ok').on('click touchstart', function () {
          execDeleteThread(threadDiv.attr('data-thread-id'));
          return false;
        });
        threadDiv.find('.request .butt.cancel').on('click touchstart', function () {
          $(this).closest('.request').empty().remove();
          return false;
        });
      }
    
      /**
       * Execute thread delete command
       *
       * @param threadId
       * @returns {boolean}
       */
      function execDeleteThread(threadId) {
        if(requesting.threadDelete[threadId]) return;
        requesting.threadDelete[threadId] = 1;
    
        $(this).addClass('exec');
    
        $.ajax({
          url: blockSettings.deleteThreadUrl,
          method: "POST",
          data: { thread_id: threadId },
          success: function (data) {
            triggerCommands(data);
            requesting.threadDelete[threadId] = 0;
          }
        });
    
        return false;
      }
    
    
      /**
       * Run update the inbox.
       */
      function loadUpdateInbox() {
        if (!inboxRequesting) {
          inboxRequesting = true;
    
          var ids = {};
          pmWindows.find('.inbox-thread-list .thread').each(function () {
            ids[$(this).attr('data-thread-id')] = $(this).attr('data-last-update');
          });
    
          $.ajax({
            url: blockSettings.loadNewThreadUrl,
            method: "POST",
            data: { ids: ids },
            success: function (data) {
              inboxRequesting = false;
              triggerCommands(data);
              if (updateInterval) {
                window.setTimeout(loadUpdateInbox, updateInterval);
              }
            }
          });
        }
      }
    
    
      /**
       * Refresh inbox after ajax call
       * @param threadIds - ids of threads
       * @param newThreads - updated threads
       */
      function updateInbox(threadIds, newThreads) {
        var revertedIndex = [];
        for(var index in threadIds) {
          revertedIndex.unshift(index);
        }
    
        var inboxWrapper = pmWindows.find('.inbox-thread-list');
        if(threadIds.length) inboxWrapper.find('.no-thread').remove();
    
        for(var i in revertedIndex) {
          var index = revertedIndex[i];
          var threadId = threadIds[index];
          var message = inboxWrapper.find('.thread-'+threadId);
    
          if(message.length) {
            message.remove().empty();
            loadThreadRefresh(threadId);
          }
          inboxWrapper.prepend(newThreads[threadId]);
          var newThread = inboxWrapper.find('.thread-'+threadId);
          if(!newThread.hasClass('own') && newThread.hasClass('new')) {
            pmWindows.addClass('new').show();
            newThreadCount(); //update count number
          }
    
          inboxWrapper.find('.thread-'+threadId).on('click touchstart', inboxThreadLinkListenerHandler);
        };
      }
    
    
      /**
       * Click Handler executed when private message threads are clicked.
       *
       * Loads the thread into the private message window.
       */
      var inboxThreadLinkListenerHandler = function (e) {
        e.preventDefault();
        var threadId = $(this).attr("data-thread-id");
        var inboxThread = pmWindows.find('.inbox-thread-list .thread-'+threadId);
        var thWrapper = pmWindows.find('.threads-wrapper');
        var thread =  thWrapper.find('.thread-'+threadId);
        if (thread.length) {
          thread.addClass('active');
          if(inboxThread.hasClass('new')) {
            inboxThreadDeNew(inboxThread);
            thread.find('textarea').focus();
          }else {
            if(thread.is(':hidden')) {
              hideLastWin(thWrapper);
            }
            thread.toggle();
          }
        } else {
          inboxThreadDeNew(inboxThread);
          loadThread(threadId);
        }
      };
    
      var newThreadCount = function () {
        var newThreadCnt = pmWindows.find('.inbox-thread-list .thread.new').length;
        pmWindows.find('.unreaded-cnt').empty().html(newThreadCnt);
        return newThreadCnt;
      };
    
    
      var inboxThreadDeNew = function(inboxThread) {
        inboxThread.removeClass('new');
    
        if(!newThreadCount()) {
          pmWindows.removeClass('new');
        }
      };
    
      /**
       * Loading upper(older) messages to the thread message list
       */
      function loadPrevMessages() {
        var loadPrevDiv = $(this);
        loadPrevDiv.addClass('loading');
        var threadDiv = loadPrevDiv.parent();
    
        var threadId = threadDiv.attr('data-thread-id');
        var firstMsgId = threadDiv.attr('data-first-msg-id');
    
        requesting.prevMsgsLoading[threadId] = true;
    
        $.ajax({
          url: blockSettings.loadPrevMsgsUrl,
          data: { thread_id:threadId, message_id:firstMsgId },
          success: function (data) {
            loadPrevDiv.removeClass('loading');
            requesting.prevMsgsLoading[threadId] = false;
            triggerCommands(data);
          }
        });
    
      }
    
      /**
       * Downloading thread content
       * @param threadId
       */
      function loadThread(threadId) {
        var threadDiv = pmWindows.find('.thread-wrapper .thread-'+threadId);
        if(threadDiv.length) return;
    
        if(requesting.thread[threadId]) return;
        requesting.thread[threadId] = true;
    
        var inboxThreadDiv = pmWindows.find('.inbox-thread-list .thread-'+threadId);
        inboxThreadDiv.addClass('opening');
    
        $.ajax({
          url: blockSettings.loadThreadMsgsUrl,
          data: { threadid:threadId },
          success: function (data) {
            inboxThreadDiv.removeClass('opening');
            requesting.thread[threadId] = false;
            triggerCommands(data);
          }
        });
      }
    
      function hideLastWin(thWrapper) {
        var thWrapperW = thWrapper.width();
        var winLimit = Math.floor(thWrapperW/winWidth);
        var existsThreads = thWrapper.find('.thread:visible');
        if(existsThreads.length >= winLimit) {
          existsThreads.each(function(i,item) {
            if((i-(-1)) >= winLimit) $(item).hide();
          });
        }
    
      }
    
      /**
       * Filling thread after ajax request
       * @param threadId - thread id
       * @param firstMsgId - begin message id
       * @param lastMsgId - end message id
       * @param userId - user id
       * @param userName - name of user
       * @param userPicture - image url of user icon
       * @param messages - html of thread messages
       * @param loadPrevTitle - "load previous" text in the right language
       */
      function loadThreadResponse(threadId, firstMsgId, lastMsgId, userId, userName, userPicture, messages, loadPrevTitle) {
        var thWrapper = pmWindows.find('.threads-wrapper');
        hideLastWin(thWrapper);
        var userPictureTag = userPicture ?  '<img src="' + userPicture + '" />' : '';
        var deleteThreadMsg = blockSettings['deleteThreadMsg'];
    
        thWrapper.prepend('<div class="thread thread-' + threadId + ' thread-user-' + userId + ' active" data-thread-id="' +
          threadId + '" data-user-id="' + userId + '" data-last-msg-id="'+lastMsgId+'" data-first-msg-id="'+firstMsgId+'">' +
          '<div class="label"><div class="x">&#xd7;</div>' + userPictureTag + userName + '</div>' +
          '<div class="load-prev">' + loadPrevTitle + '</div>' +
          '<div class="messages"></div><div class="operations"><div class="delete-thread">' + deleteThreadMsg +  '</div><textarea></textarea><input type="button" value="Send" /></div></div>');
        var threadDiv = thWrapper.find('.thread-'+threadId);
        threadDiv.find('.load-prev').on('click touchstart', loadPrevMessages);
        var threadMsgDiv = threadDiv.find('.messages');
        threadMsgDiv.prepend(messages);
        threadDiv.find('input[type="button"]').on('click touchstart', sendMessage);
        threadDiv.find('.label').on('click touchstart', showHideWin);
        threadDiv.find('.label .x').on('click touchstart', function () { $(this).closest('.thread').hide(); return false; });
        threadDiv.find('.delete-thread').on('click touchstart', runDeleteThread);
        messagesScrollDown(threadDiv);
      }
    
      /**
       * Get user list for new thread creation
       */
      function getUserList4NewThread() {
        if(requesting.userSearch) requesting.userSearch.abort();
    
        var searchLine = $(this).val().trim();
        if((!searchLine) || (searchLine.length < 3)) return;
    
        requesting.userSearch = $.ajax({
          url: blockSettings.getUsersUrl,
          data: { user_name:searchLine },
          method: 'POST',
          success: function (data) {
            requesting.userSearch = false;
            triggerCommands(data);
          }
        });
    
      }
    
      /**
       * Show user list for start new thread
       *
       * @param userList
       */
      function showSearchedUserList(userList) {
        var userListTag = pmWindows.find('.new-user-search .user-list');
        userListTag.empty();
        for(var i in userList) {
          var user = userList[i];
          userListTag.append('<div class="user-for-new-thread" data-uid="' + user.uid + '">' + user.username + '</div>');
        }
    
        userListTag.find('.user-for-new-thread').on('click', function () {
          var uid = parseInt($(this).attr('data-uid'));
          userListTag.empty();
          pmWindows.find('.new-user-search input').val('');
    
          if(uid) openRecipientMessage(uid);
    
          return false;
        })
    
      }
    
    
      /**
       * Send message to user
       */
      function sendMessage() {
        var $this = $(this);
        var operations = $this.closest('.operations');
        operations.addClass('sending');
        var textArea = operations.find('textarea');
        var text = textArea.val();
        var thread = $this.closest('.thread');
        var threadId = thread.attr('data-thread-id');
        var msgId = thread.attr('data-last-msg-id');
    
        if(requesting.msgSend[threadId]) return;
        requesting.msgSend[threadId] = true;
    
        $.ajax({
          url: blockSettings.sendMsgUrl,
          data: { thread_id:threadId, text:text, last_message_id:msgId },
          method: 'POST',
          success: function (data) {
            textArea.val('');
            requesting.msgSend[threadId] = false;
            operations.removeClass('sending');
            triggerCommands(data);
          }
        });
    
      }
    
    
      /**
       * Respone to the ajax request of previous thread messages
       * @param oldMessages
       * @param threadId
       * @param firstMessageId
       * @param hasNext
       */
      function insertOldThreadMsgs(oldMessages, threadId, firstMessageId, hasNext) {
        var thread = pmWindows.find('.threads-wrapper .thread-'+threadId);
        var threadMessages = thread.find('.messages');
        
        
        //const elements = once('private-message-'+firstMessageId, 'private-message-'+firstMessageId);
       
         
        
        var messages = $('<div>' + oldMessages + '</div').find('.private-message');
    
        if(!messages.length) { thread.find('.load-prev').hide(); return; }
    
        var firstMsgId = thread.attr('data-first-msg-id');
        var messages4Insert = {};
        var newFirstMsgId = firstMsgId;
        //to avoid duplicate of messages, we need existing check
        messages.each(function(i, item) {
          var msg = $(item);
          var msgId = msg.attr('data-message-id');
          if(!threadMessages.find('#private-message-' + msgId).length && (firstMsgId > msgId)) {
            messages4Insert[msgId] = item;
            if(newFirstMsgId> msgId) newFirstMsgId = msgId;
          }
        });
        var ids = Object.keys(messages4Insert);
        ids.sort(function(a, b){ return b - a; });//inserting backward
        for(var i in ids) {
          threadMessages.prepend(messages4Insert[ids[i]]);
        }
        thread.attr('data-first-msg-id', newFirstMsgId);
    
      }
    
    
      /**
       * Response to the ajax request of message sending or thread update
       */
      function updateThreadMsgs(newMessages, threadId, lastMsgId) {
        var thread = pmWindows.find('.threads-wrapper .thread-'+threadId);
        var threadMessages = thread.find('.messages'); 
        
        const elements = once('private-message-'+lastMsgId, '.private-message');
    
        
        var messages = $('<div>' + newMessages + '</div').find('.private-message');
        var oldMsgId = thread.attr('data-last-msg-id');
    
        //to avoid duplicate of messages, we add each message with existing check
        messages.each(function(i, item) {
          var msg = $(item);
          var msgId = msg.attr('data-message-id');
          if(!threadMessages.find('#private-message-' + msgId).length && (oldMsgId < msgId)) {
            threadMessages.append(item);
            thread.attr('data-last-msg-id', msgId);
            oldMsgId = msgId;
          }
        });
        messagesScrollDown(thread);
        loadUpdateInbox();
      }
    
    
      /**
       * Refresh of thread window for new messages
       * @param threadId
       */
      function loadThreadRefresh(threadId) {
        var threadDiv = pmWindows.find('.threads-wrapper .thread-'+threadId);
        if(!threadDiv.length) return;
    
        if(requesting.threadRefresh[threadId]) return;
        requesting.threadRefresh[threadId] = true;
    
        var msgId = threadDiv.attr('data-last-msg-id');
        $.ajax({
          url: blockSettings.loadNewMsgsUrl,
          data: { thread_id:threadId, message_id: msgId },
          success: function (data) {
            requesting.threadRefresh[threadId] = false;
            triggerCommands(data);
          }
        });
      }
    
      /**
       * Moving message list to the last message
       * @param threadDiv
       */
      function messagesScrollDown(threadDiv) {
        var messages = threadDiv.find('.messages');
        var height = 0;
        messages.find('.private-message').each(function(i,item){
          height -= (-1)*$(item).outerHeight();
        });
        messages.scrollTop(height - (-1)*300);
      }
    
      /**
       * Click on the recipient link for new thread creation
       *
       * @param e
       */
      function newRecipientMessage(e) {
        e.stopPropagation();
        e.preventDefault();
    
        let aTag = $(this);
        let href = aTag.attr('href');
        let check = new RegExp('recipient=(\\d+)');
        let checkRes = check.exec(href);
        if(!checkRes[1] || !(checkRes[1]>0)) {
          window.location = href;
          return;
        }
    
        openRecipientMessage(checkRes[1])
      }
    
      /**
       * Click on the recipient link to open exists thread
       *
       * @param e
       */
      function existsRecipientThread(e) {
        e.stopPropagation();
        e.preventDefault();
    
        let aTag = $(this);
        let href = aTag.attr('href');
        let check = new RegExp('/private-messages/(\\d+)');
        let checkRes = check.exec(href);
        if(!checkRes[1] || !(checkRes[1]>0)) {
          window.location = href;
          return;
        }
    
        openThreadMessages(checkRes[1])
      }
    
    
      /**
       * Opening a window with exists thread
       *
       * @param threadId
       */
      function openThreadMessages(threadId) {
        if(requesting.existsThread) return;
        requesting.existsThread = true;
    
        pmWindows.show();
    
        let userThreadLink = pmWindows.find('.inbox-thread-list .thread-' + threadId);
    
        if (userThreadLink.length) {
          let userThread = pmWindows.find('.threads-wrapper .thread-' + threadId);
    
          if(userThread.length) {
            userThread.addClass('active').show();
          } else {
            userThreadLink.trigger('click');
          }
    
          requesting.existsThread = false;
          return;
        }
    
        $.ajax({
          url: blockSettings.loadThreadMsgsUrl,
          data: { threadid: threadId },
          method: 'POST',
          success: function (data) {
            requesting.existsThread = false;
            triggerCommands(data);
          }
        });
      }
    
    
      /**
       * Opening a window for new thread (with new contact)
       *
       * @param recipientId
       */
      function openRecipientMessage(recipientId) {
        if(requesting.newThread) return;
        requesting.newThread = true;
    
        pmWindows.show();
    
        var userThreadLink = pmWindows.find('.inbox-thread-list .thread-user-' + recipientId);
    
        if(userThreadLink.length) {
          var userThread = pmWindows.find('.threads-wrapper .thread-user-' + recipientId);
    
          if(userThread.length) {
            userThread.addClass('active').show();
          } else {
            userThreadLink.trigger('click');
          }
    
          requesting.newThread = false;
          return;
        }
    
        $.ajax({
          url: blockSettings.newThreadUrl,
          data: { recip_id:recipientId },
          method: 'POST',
          success: function (data) {
            requesting.newThread = false;
            triggerCommands(data);
          }
        });
    
      }
    
    
      /**
       * Cleaning interface after thread deleting
       * @param threadId
       */
      function deleteThread(threadId) {
        pmWindows.find('.inbox-thread-list .thread.thread-' + threadId).empty().remove();
        pmWindows.find('.threads-wrapper .thread-' + threadId).empty().remove();
      }
    
    
      Drupal.behaviors.privateMessageWindowsThreadList = {
        attach:function (context) {
          init(context);
    
          Drupal.AjaxCommands.prototype.
            PrivateMessageWindowsInboxUpdate = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            updateInbox(response.threadIds, response.newThreads);
          };
    
          Drupal.AjaxCommands.prototype.PrivateMessageWindowsFillThread = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            loadThreadResponse(response.threadId, response.firstMsgId, response.lastMsgId, response.userId, response.userName, response.userPicture, response.messages, response.loadPrevTitle);
          };
    
          Drupal.AjaxCommands.prototype.PrivateMessageThreadMsgsUpdate = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            updateThreadMsgs(response.messages, response.threadId, response.lastMsgId);
          };
    
          Drupal.AjaxCommands.prototype.PrivateMessageInsThreadOldMessages = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            insertOldThreadMsgs(response.messages, response.threadId, response.firstMessageId, response.hasNext);
          };
    
          Drupal.AjaxCommands.prototype.PrivateMessageShowUserList = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            showSearchedUserList(response.users);
          };
    
          Drupal.AjaxCommands.prototype.PrivateMessageDeleteThread = function (ajax, response) {
            ajax = ajax; // For jSlint compatibility.
    
            deleteThread(response.thread_id);
          };
        },
        detach:function (context) {
        }
      };
    
    
    }(jQuery, Drupal, drupalSettings, window));
    
    
    
    
    
    
    
    

    No time to create a patach, the above fixes the the Javascript updates needed for D10

  • Guys, thank you! I'll fix it today-tomorrow and will create new version.

  • rblake87, your changes are not working on Drupal 9 on my web-site.
    This changes will not be applied yet. I'll try to install Drupal 10 to check it

    • 2c69761f committed on 8.x-1.x
      Issue #3297890 by sidharth_soman: Automated Drupal 10 compatibility...
  • Status changed to Fixed 12 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024