Fetch icon indicating copy to clipboard operation
Fetch copied to clipboard

Message->loadMessage() error; message without subject (empty)

Open Apacz opened this issue 9 years ago • 3 comments

Undefined property: stdClass::$subject in /var/www/html/thor-lovo/vendor/tedivm/fetch/src/Fetch/Message.php line 236

Problem is when i try to search on the server. If is any message is with empty subject then i can't remove or do anything ... my process is stopped

Apacz avatar Dec 16 '15 14:12 Apacz

Same thing, however, messages are really present and have subjects.

You should add if (isset($messageOverview->subject).... check.

andrewtch avatar Dec 18 '15 12:12 andrewtch

Yes, I Overwrited your method becouse i had to use \Fetch\Server->seach() and that makes error.

just i did:
protected function loadMessage() { if(!property_exists($messageOverview,'subject')) { $messageOverview->subject = ''; } return parent::loadMessage(); } and it work, but still it cant work without little change.

Apacz avatar Dec 18 '15 13:12 Apacz

I have fixed this in src/Fetch/Message.php

protected function loadMessage() { //First load the message overview information if (!is_object($messageOverview = $this->getOverview())) return false; if (property_exists($this->messageOverview, 'subject')) { $this->subject = MIME::decode($messageOverview->subject, self::$charset); } else { $this->subject = "No subject - PLEASE CHANGE!"; } $this->date = strtotime($messageOverview->date); $this->size = $messageOverview->size; foreach (self::$flagTypes as $flag) $this->status[$flag] = ($messageOverview->$flag == 1); // Next load in all of the header information

https://github.com/deemyboy/Fetch/blob/master/src/Fetch/Message.php

deemyboy avatar Nov 17 '16 01:11 deemyboy