I just noticed that the HTML structure is not consistent when inserting new messages in the conversation (Loading old ones or sending new ones). The ajax callback returns only the messages without the wrapper class that is added by the preprocess.
/**
* Implements hook_preprocess_field().
*
* Adds a custom class to the field that can be targeted, as the default classes
* may be altered in themes/templates, and therefore should not be depended
* upon.
*/
function private_message_preprocess_field__private_message_thread__private_messages(&$vars) {
foreach (array_keys($vars['items']) as $index) {
$vars['items'][$index]['attributes']->setAttribute('class', 'private-message-wrapper');
}
}
Code print when loading the page:
<div class="private-message-wrapper field__item">
<div id="private-message-62">
Content
</div>
</div>
Code inserted when inserting by ajax:
<div id="private-message-62">
Content
</div>
We should returns the same HTML structure when loading new messages by ajax. I did a quick patch to keep at least that wrapper (The JS rely on it but it is probably not necessary and easily removable).
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.