Skip to main content
Topic: Sending of PMs not possible (Read 3125 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sending of PMs not possible

Beta 2: If your're saving a PM as draft and you want to send it later, you get the following error message:

QuoteFatal error: Call to a member function hasChildNodes() on a non-object in /www/htdocs/w00f21f1/elkarte/sources/subs/Html2Markdown.class.php on line 217

Second question: Will automatically saved drafts ever be removed (when draft is send)? It seems not...

Edit: We are getting the error message not only with PMs saved as drafts before, but with every PM we are trying to send. And: the PMs are send and are received, despite the error message.

Are there no notifications of new PMs in the "Be Social!" variation of the theme? We are getting no number in the header if new PMs arrived.

Re: Sending of PMs not possible

Reply #1

Quote from: Jorin – Beta 2: If your're saving a PM as draft and you want to Are there no notifications of new PMs in the "Be Social!" variation of the theme? We are getting no number in the header if new PMs arrived.
there shoul be a small organge indicator with the number of unread pms, the same we use for mentions.
Note: PMs from yourself do not activate that counter ..
Thorsten "TE" Eurich
------------------------

Re: Sending of PMs not possible

Reply #2

Okay, than this (the notification) is not working too.

Re: Sending of PMs not possible

Reply #3

After an hour of debugging I found the reason (not the solution) for this bug
Quote Fatal error: Call to a member function hasChildNodes() on a non-object in /www/htdocs/w00f21f1/elkarte/sources/subs/Html2Markdown.class.php on line 217
That only happens with the Setting "Don't allow post text in notifications" enabled.
pbe_prepare_text() gets an empty $message and this fails with the new Convert_Md($message);  later.

@Spuds help please?
Thorsten "TE" Eurich
------------------------

Re: Sending of PMs not possible

Reply #4

Thanks for the debug ... I'll take a look and see what to do.    That function is being used to prepare the PM for the email (done as markdown).  So if Don't allow post text in notifications is set, well there is no text to send in the PM so the function throws an error.  Easy fix is to just check that condition in the function and return a blank string.
Last Edit: February 12, 2014, 03:22:59 pm by Spuds

Re: Sending of PMs not possible

Reply #5

Well the quick fix for this should be in PersonalMessages.subs.php, have not tried it yet
Code: (find) [Select]
	// If they have post by email enabled, override disallow_sendBody
if (!$maillist && !empty($modSettings['disallow_sendBody']))
$message = '';

require_once(SUBSDIR . '/Emailpost.subs.php');
pbe_prepare_text($message, $subject);
Code: (replace) [Select]
	// If they have post by email enabled, override disallow_sendBody
if (!$maillist && !empty($modSettings['disallow_sendBody']))
{
$message = '';
censorText($subject);
}
else
{
require_once(SUBSDIR . '/Emailpost.subs.php');
pbe_prepare_text($message, $subject);
}

I'll also make an update to the class so it does not toss that error should it ever bet a blank message.

Re: Sending of PMs not possible

Reply #6

Quote from: Jorin – Okay, than this (the notification) is not working too.
Thats a bonus issue, two for the price of one, a BOGO  :)

The "Fatal error: Call to a member function hasChildNodes() on a non-object in /www/htdocs/w00f21f1/elkarte/sources/subs/Html2Markdown.class.php on line 217"    means execution stops at that point, however the counter is updated after that step and its not getting there.  With the above fix the counter will start working.

QuoteSecond question: Will automatically saved drafts ever be removed (when draft is send)? It seems not...
I'm checking on the draft item, I just tried and it worked as expected (draft deleted after it was sent) but will look a bit further.

ETA: Well its a buy one get TWO free ... both the counter and the draft removal happen after the point of the fatal error.  Fix the one error and the other two issues will clear up.  If you don't want to make the code edit, then go to your admin panel and configuration->features and options->general ... un check "Don't allow post text in notifications" and the error should be gone.
Last Edit: February 12, 2014, 03:24:00 pm by Spuds