Preview message problem
softtouch - March 5, 2008 - 08:32
| Project: | Privatemsg |
| Version: | 5.x-3.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
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.

#1
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?
#2
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_formfunction in theprivatemsg.modulefile. 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>'
);