In D7, privatemsg_message is fieldable. However, field content does not show on a message until a cache clear, which is very confusing to users.

CommentFileSizeAuthor
#2 privatemsg.clear_field_cache_2577823_02.patch462 bytesrfay
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rfay created an issue. See original summary.

rfay’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
462 bytes

I believe the attached patch is the correct solution, but maybe there's another way?

If you have this problem and just need a workaround instead of a patch, you can implement this in a custom module:

function MODULE_NAME_field_attach_insert($entity_type, $entity) {
  if ($entity_type == 'privatemsg_message') {
    cache_clear_all("field:privatemsg_message:{$entity->mid}", 'cache_field');
  }
}

  • oadaeh committed 665d92f on 7.x-1.x authored by rfay
    Issue #2577823 by rfay: Fields on privatemsg do not show until cache...

  • oadaeh committed c4226e6 on 7.x-2.x authored by rfay
    Issue #2577823 by rfay: Fields on privatemsg do not show until cache...
oadaeh’s picture

Status: Needs review » Fixed

We've been using the patch on a 7.x-2.x branch in production since the middle of last year with no problems, and since it seems like a bug to me, I've committed it to both 7.x-1.x and 7.x-2.x. Thanks for the patch, Randy.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.