Skip to main content
Topic: Errors Undefined index: unread_messages and Undefined index: id (Read 1684 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Errors Undefined index: unread_messages and Undefined index: id

Hi,
Each time a user click on Messages i get an error in the logs : Undefined index: unread_messages.
These errors are all the same and are linked to the line 307 in the PersonnalMessage.controller.php.
307:    $label_counters = array('unread_messages' => $context['labels'][-1]['unread_messages']);
How can i solve it please ?
Thank you,
Philippe

EDIT1
In the same file there are also the errors Undefined index: id in the lines
1616: if ($label['id'] != -1)
1617: {                                                                        //not in error, just to see the code
1618: $the_labels[$label['id']] = $label['name'];

2874: 'id' => $label['id'],

Something with $label['id'] seems to be wrong, but what ?
Philippe
Last Edit: April 23, 2018, 06:35:55 am by augras

Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #1

Yep, it's reported and there is a fix, it was not added to 1.1.3 because it was too late.
I can't search right now, as soon as I can I'll post here the topic.
Bugs creator.
Features destroyer.
Template killer.

Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #2

Ok, thank you emmanuele.
All the errors are fixed, even the Undefined index: id errors in the EDIT1 ?
Philippe

Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #3

Hi, just to remember to post the fix please :D
Philippe
Last Edit: May 05, 2018, 05:05:57 am by augras


Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #5

Hi Spuds,
it seems to be the same thing.
This issue is in fact still on and there is not yet a patch ? (Github is not clear for me ).
Philippe

Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #6

it will be in 1.1.4

the fix is to edit sources/subs/PersonalMessage.subs.php and remove line 84 which says
Code: [Select]
$labels = array();

Please note as you make edits to 1.1.3, when the 1.1.4 patch arrives you will likely get some errors during installation since some fixes will have already been applied, ... so just keep that in mind.

Re: Errors Undefined index: unread_messages and Undefined index: id

Reply #7

Thank you again Spuds,
I will try to remember all the changes in my files and not come here to ask for errors coming from these changes.
Philippe