Closed Bug 10504 Opened 21 years ago Closed 21 years ago

[blocker] Sending a message doesn't send the body

Categories

(MailNews Core :: Composition, defect, P3, blocker)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: scottputterman, Assigned: akkzilla)

Details

Open up an HTML message compose window (haven't tried this on plain text).  Type
in a message into the body.  Send it.  When you get it, the message will not
have the body.
Status: NEW → ASSIGNED
Target Milestone: M9
Waiting on a clobber build and will investigate to see what is going on.

- rhp
Assignee: rhp → akkana
Status: ASSIGNED → NEW
ok, it looks like everything is ok in the compose back end, but we are failing
on  the call to:  GetContentAs()

Here is the code leading up to the call:

  //
  // Query the editor, get the body of HTML!
  //
  nsString  format(TEXT_HTML);
  PRUint32  flags = 0;
  PRUnichar *bodyText = NULL;

  // Ok, get the body...the DOM should have been whacked with
  // Content ID's already
  mEditor->GetContentsAs(format.GetUnicode(), flags, &bodyText);


I traced into this further and we eventually get to a call WillDoAction and we
immediately return with a failure because aSelection is NULL. Here is the check
that fails:

NS_IMETHODIMP
nsHTMLEditRules::WillDoAction(nsIDOMSelection *aSelection,
                              nsRulesInfo *aInfo, PRBool *aCancel)
{
  if (!aSelection || !aInfo || !aCancel)
    return NS_ERROR_NULL_POINTER;

Not sure what to do from here so reassigning to akkana for some help.

- rhp
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Rich, Steve and I tracked down the problem and Rich has checked in a fix.
Here's what happened: Steve noticed a bug in the text edit rules where
WillDoAction required the selection to be set even for routines (like getting
the whole document output) which don't need it).  He also noticed that
nsTextEditor::OutputToString was ignoring the result of WillDoAction.  He fixed
both of these problems.  The problem was that the html edit rules still had the
first bug (requiring the selection), so nsHTMLEditor::OutputToString (which just
calls the text editor version, but with html edit rules) was failing.  The fix
was to make the corresponding fix to the html edit rules, to not require a
selection.
Severity: normal → blocker
QA Contact: lchiang → esther
esther - can you verify?  Thanks.
Status: RESOLVED → VERIFIED
Using 19990816 builds on win32, linux and Mac (note this was Ninoschka's Mac),
and using the scenario provided, this is fixed.  The message received is not
blank.  We sent text with no html attributtes in the body using a html compose
window and text with html in body using the html compose window, both worked OK.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.