If I create a new PM and click preview, the message is displayed properly, but anywhere is a closing tag lacking. The background of the theme become transparent (like a

or something else is anywhere lacking.
This happen only with the pm module, and only with preview.

Comments

typehost’s picture

We are having a similar problem. If creating a private message, the URL displayed is:
privatemsg/new

After clicking on "preview" - the page reloads, and the entire right column of the theme collapses to the far left of the screen, overlapping the message and the content in the main section.

This is the only place on the site that I have noticed this - and, I am not sure where to start debugging it - as the url for both pages is the same: privatemsg/new

What can be causing this?

ron_s’s picture

Version: 5.x-1.8 » 5.x-3.0
Component: Miscellaneous » Code
Category: support » bug
Status: Active » Needs review

I'm noticing this issue on our theme, which has been built off of the NewsFlash theme.

What I was able to do to resolve this is comment out two lines of code which cause the conflict. The lines are in the privatemsg_new_form function in the privatemsg.module file. Around line 1493 is the following code:

  $form['preview'] = array(
    '#type' => 'submit',
    '#value' => t('Preview'),
    '#prefix' => '<div class="pm-controls">'
  );
  $form['send'] = array(
    '#type' => 'submit',
    '#value' => t('Send private message')
  );
  $form['cancel'] = array(
    '#value' => l(t('Cancel'), arg(1) == 'reply' ? 'privatemsg/view/'. arg(2) : 'privatemsg'),
    '#suffix' => '</div>'
  );

The issue is when on the Preview page, there is no Preview submit button. Therefore what happens is the form creates malformed HTML, where there is a closing DIV tag (rendered from the Cancel button), but there is no opening DIV tag (no Preview button). Just comment out the DIV wrapper and it will fix the HTML issue:

  $form['preview'] = array(
    '#type' => 'submit',
    '#value' => t('Preview'),
    //'#prefix' => '<div class="pm-controls">'
  );
  $form['send'] = array(
    '#type' => 'submit',
    '#value' => t('Send private message')
  );
  $form['cancel'] = array(
    '#value' => l(t('Cancel'), arg(1) == 'reply' ? 'privatemsg/view/'. arg(2) : 'privatemsg'),
    //'#suffix' => '</div>'
  );
Berdir’s picture

Status: Needs review » Closed (won't fix)

I'm closing old issues since Privatemsg for Drupal 5 is not maintained anymore. I suggest you switch to Drupal 6 if possible, many of the reported issues are probably already resolved there and if not, you're welcome to open a new issue.