Do something that will create a private message and then try to open that message
An error has occurred.
0 Call to undefined method stdClass::set()
Call Stack
# Function Location
1 () JROOT\administrator\components\com_messages\src\Model\MessageModel.php:191
2 Joomla\Component\Messages\Administrator\Model\MessageModel->getItem() JROOT\administrator\components\com_messages\src\Model\MessageModel.php:233
3 Joomla\Component\Messages\Administrator\Model\MessageModel->loadFormData() JROOT\libraries\src\MVC\Model\FormBehaviorTrait.php:108
4 Joomla\CMS\MVC\Model\FormModel->loadForm() JROOT\administrator\components\com_messages\src\Model\MessageModel.php:211
5 Joomla\Component\Messages\Administrator\Model\MessageModel->getForm() JROOT\administrator\components\com_messages\src\View\Message\HtmlView.php:70
6 Joomla\Component\Messages\Administrator\View\Message\HtmlView->display() JROOT\libraries\src\MVC\Controller\BaseController.php:697
7 Joomla\CMS\MVC\Controller\BaseController->display() JROOT\administrator\components\com_messages\src\Controller\DisplayController.php:65
8 Joomla\Component\Messages\Administrator\Controller\DisplayController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:730
9 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
10 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:205
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:304
14 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58
15 require_once() JROOT\administrator\index.php:32
Labels |
Added:
No Code Attached Yet
|
No, it is simpler than that. Just assign the value to property directly instead of using set method. So, change code from:
$this->item->set('user_id_to', $message->user_id_from);
To:
$this->item->user_id_to = $message->user_id_from;
There are 3 lines of code need to be changed in getItem
method of MessageModel
@joomdonation can i implement this change and pull a PR ? [ The 3 lines needing the change being 167, 171, 192 ]
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-03-25 12:03:32 |
Closed_By | ⇒ | joomdonation |
@joomdonation hello, you don't have to apologise , i am only a student and was thinking if it would be more convenient for you if i pulled the PR. Hopefully im not being a pest.
@hiteshm0 Yes, I know and actually I wanted you to make the PR, that was the reason I described the solution. But I then realized that testing instructions could be difficult for you - who is still new with Joomla (because we need to have private message added for the account to see the error) - that was the reason I made the PR myself. Hope to see your PR for other issue/feature in near future.
@joomdonation sorry i missed your message , and thank you for the words of encouragement 👍
Could converting the stdClass object to a registry object be a potential fix ?