Privatemessage D8

Component ID

2395689

Component name

Privatemessage D8

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Experimental version of D8 privatemessage.

Works with Beta4

Overview:

  • Threads are implemented via new entity type.
  • Messages are comment field attached to threads.
  • Two new field types added: thread participant and message recipient, which extends functionality of entity reference, but hold additional information about messages and thread.
  • Thread participant field is a replacement for pm_thread_user table from this patch: https://www.drupal.org/files/issues/744374.patch #744374: Introduce a pm_thread table and holds similar information
  • Message recipient field is used for determining access to the message, but also used for check if message is new (functionality similar to pm_index table from privatemsg).
  • Email notifications works like in D7 version with several changes.
  • Marking messages and threads as read are done wia AJAX call.

What works:

  • Sending messages to single or multiple recepients
  • List of own privatemessage threads
  • Access control to the threads and messages
  • Basic views integration
  • Tracking read/unread messages for every thread participant
  • Mail notifications about private messages

Known problems:

  • No replacement for numerous D7-version features
  • Module/functions/classes names. Module was started for own needs and it wasn't planned to create a strict D8 port for privatemsg
  • Some architectural approaches may be poor: for example it may be not a best idea to create own field type if it will be used with our custom entity only.
  • Code is untested (automated tests missing as well) and may contain serious bugs (for example CSFR vulnerability in SwPmThreadController)
  • It is my first big D8 project, so I'm not very familiar with it: I may use outdated or incorrect approaches.
  • Thread edition breaks values in the participants field: widget should have custom implementation rather than using entity reference one
  • There are no ability to send messages for roles or any other entity type rather than users. It can be solved in several ways, but no work was done in this way.