SimpleDesk

SimpleDesk! => SimpleDesk Support => Topic started by: digiscrap on April 13, 2010, 05:50:16 PM

Title: Error: Undefined index (3x)
Post by: digiscrap on April 13, 2010, 05:50:16 PM
Hello,

Thanks for this great mod. I 'met' it on PortaMx. We are running a website for digital scrapbooking with approximately 2000 members. We're using SMF2.0RC3+PortaMx with a custom theme.

In the log I see 3 errors but I can't find anything what is going wrong. All is working fine as far as I can see....  8) Maybe it has something to do with translation or the custom theme? I copied the English files to Dutch... didn't translate anything for now.

The errors:

URL http://digiscrap.nl/index.php?action=helpdesk;sa=ticket;ticket=8
8: Undefined index: text
File: /shared/usr/xxxxxxxxxxxxxxxx/DOMAIN/www.digiscrap.nl/HTML/Sources/SimpleDesk-Display.php
Line: 432


URL http://digiscrap.nl/index.php?action=helpdesk;sa=ticket;ticket=8
8: Undefined index: display
File: /shared/usr/xxxxxxxxxxxxxxxx/DOMAIN/www.digiscrap.nl/HTML/Sources/SimpleDesk-Display.php
Line: 429


URL http://digiscrap.nl/index.php?action=helpdesk;sa=ticket;ticket=8
8: Undefined index: text
File: /shared/usr/xxxxxxxxxxxxxxxx/DOMAIN/www.digiscrap.nl/HTML/Sources/SimpleDesk-Display.php
Line: 429


Thanks for your support!

Vincent
Title: Re: Error: Undefined index (3x)
Post by: ccbtimewiz on April 13, 2010, 07:40:13 PM
Alright... looking at the file in question, the issue seems to be related the array loaded keys... however from a glance it doesn't appear that those particular words could result in that (as the key has predefined text in it...).

So, in SimpleDesk-Display.php, we have the following strands:

if ($modSettings['shd_ticketnav_style'] == 'smf')
foreach ($context['ticket_navigation'] as $key => $button)
{
$context['can_' . $button['text']] = $button['display'];
$context['ticket_navigation'][$key] += array(
'lang' => true,
'test' => 'can_' . $button['text'],
'image' => 'shd_ticket_' . $button['icon'] . '.png',
);
}


Your undefined issues are resulting from $button['text'] apparently, so try the following edits and see if it fixes the problem. In addition, clear your Error Log and your system cache.

if ($modSettings['shd_ticketnav_style'] == 'smf')
foreach ($context['ticket_navigation'] as $key => $button)
{
$button['text'] = !empty($button['text']) ? $button['text'] : '';
$button['icon'] = !empty($button['icon']) ? $button['icon'] : '';

$context['can_' . $button['text']] = $button['display'];

$context['ticket_navigation'][$key] += array(
'lang' => true,
'test' => 'can_' . $button['text'],
'image' => 'shd_ticket_' . $button['icon'] . '.png',
);
}
Title: Re: Error: Undefined index (3x)
Post by: digiscrap on April 14, 2010, 06:58:22 AM
Thanks for the fix....

I did the edit an have to wait and see if the error still appears. The error only appears when one of our moderators go into the helpdesk not by myself (admin). So maybe it is an permission issue?

We'll see what happens....

Vincent
Title: Re: Error: Undefined index (3x)
Post by: Gruffen on April 14, 2010, 07:11:12 AM
Yeah, it's a bug related to not having sufficient permissions to see the assign button.

To fix:
Code (find) Select
$assign_nav = array(
'url' => $scripturl . '?action=helpdesk;sa=assign;ticket=' . $context['ticket']['id'] . ';' . $context['session_var'] . '=' . $context['session_id'],
'icon' => 'assign',
'alt' => '*',
);


Code (replace) Select
$assign_nav = array(
'url' => $scripturl . '?action=helpdesk;sa=assign;ticket=' . $context['ticket']['id'] . ';' . $context['session_var'] . '=' . $context['session_id'],
'icon' => 'assign',
'alt' => '*',
'text' => '',
'display' => false,
);


I'm committing this to the master source now (it's in SVN, r553)
Title: Re: Error: Undefined index (3x)
Post by: digiscrap on April 14, 2010, 07:24:40 AM
Ah, thank you!

Will replace it...

Vicnent
Title: Re: Error: Undefined index (3x)
Post by: hadesflames on April 15, 2010, 10:21:09 AM
Marking as solved.