Too many error logs

Started by ninik, December 05, 2017, 12:15:58 PM

Previous topic - Next topic

ninik

Hi guys I have a question:

Although everything works fine in the forum, whenever someone logs in, or searches for a topic etc. I always get an error log, which is:

8: Undefined index: notify

I could locate the source of the problem in the following file:

forum/Sources/Subs-adkblog.php

in the following 2 lines:

Line: 61

Line: 63


In other words, all errors derive from these two lines.

The code of this part is the following:



'blog_notify' => array(
'title' => $txt['blog_not'].' <i>('.$context['notify'][1].')</i>',   <---- line 61
'href' => $scripturl.'?action=blog_notify',
'show' => $context['notify'][0],                                              <---- line 63
),
),
array_slice($buttons, $find_me)
);



Could anyone tell me how to resolve that issue?

Thank you in advance guys

Sir Osis of Liver

Errors are being caused by ADK Blog mod.  You need to take this over to the mod support topic -

https://www.simplemachines.org/community/index.php?topic=398380.0
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

ninik

Hi Sir Osis of Liver,

and thank you for your reply.

Frankly speaking, I did post my question there... but nobody did post anything since February of 2017; so I am worried that I will not receive any help from over there.

Consequently, by posting it here, I did hope that someone might have encountered a similar problem and did solve it in the past.


Sir Osis of Liver

If you just want to eliminate the errors, you can make some fudge -



if (!isset($context['notify'][1]))
$context['notify'][1] = '';
if (!isset($context['notify'][0]))
$context['notify'][0] = '';

'blog_notify' => array(
'title' => $txt['blog_not'].' <i>('.$context['notify'][1].')</i>',   <---- line 61
'href' => $scripturl.'?action=blog_notify',
'show' => $context['notify'][0],                                              <---- line 63
),
),
array_slice($buttons, $find_me)
);


  :P
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Suki

notify is been used without checking for its existance first. Attach that file here to see if that key is suppose to always be filled with something or if its just a programming slip
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ninik

Sir Osis of Liver, nice one... I give you that

Hi Suki, sorry but I did not quite understand which file you would like me to attach? The Subs-adkblog.php?

Edit: If so, i just did attache it...

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ninik

I just did attach it in my above post

Suki

So, func checkNotify() define $context['notify'] and then that var is used somewhere else which means $context['notify'] indeed is suppose to always exists and have something, by default false and a zero.

The problem seems to be checkNotify() isn't been called by anyone. According to the mod's parser, that function should be called on index.php:



//Load blog's not
checkNotify();

// Attachments don't require the entire theme to be loaded.


Which is a weird place to do so but thats another matter altogether.

So, make sure you have that piece of code on your index.php file and the error should go away.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ninik

Hi Suki,

I apologize for my late reply.

I did put the piece of code that you did provide me above in my index.php (please note: I did put it in the theme's index.php not the default's one).

Consequently, the code of the theme's index.php looks as follows:



<?php



// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
else
exit;

//Load blog's not
checkNotify();

// Attachments don't require the entire theme to be loaded.

?>



Nevertheless, the problem still remains and error logs are still generated.

Illori

wrong place to put it. this is not a theme related issue. you need to remove it and put in the main index.php file not any other. index.php is in the same folder you will find Settings.php and SSI.php.

ninik

OK, got it... and thank you Illori  :)

Now do I put it just randomly in the index.php or in a specific section?

Illori

check if it already exists in the file first.

ninik

Hi Illori,

no, the function


checkNotify();


does not exist in the main index.php...

Illori

then add it before the closing ?>

ninik

I did what you asked me to but the errors still continue.

To be more precise I still get the following 2 error logs (as seen below):


8: Undefined index:

notifyApply Filter: Only show the errors from this file File:
...Sources/Subs-adkblog.php
Line: 63




8: Undefined index: notifyApply Filter: Only show the errors from this file File:

...Sources/Subs-adkblog.php
Line: 61


and the end of the main index.php looks like this:



..............


// Fall through to the board index then...
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}

// Otherwise, it was set - so let's go to that action.
require_once($sourcedir . '/' . $actionArray[$_REQUEST['action']][0]);
return $actionArray[$_REQUEST['action']][1];
}

//Load blog's not
checkNotify();

// Attachments don't require the entire theme to be loaded.


?>

Suki

Add it where the parser indicates, before this line:

// Attachments don't require the entire theme to be loaded.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ninik

Hi Suki,

I did it but problem still remains...

I am attaching the entire index.php (the addition of the function has been made at line 197)...

Hope it helps

Sir Osis of Liver

Looks like index.php is correct, may be another problem in the mod.  If everything's working ok, do the fudge I posted above, it will eliminate the errors.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

ninik

Hi Sir Osis of Liver,

to make sure that I did understand you correctly...

I should go into the Subs-adkblog.php

and add your piece of code right above the existing one?

Also, should I delete the following section from the index.php that I did add?


//Load blog's not
checkNotify();

// Attachments don't require the entire theme to be loaded.


As a final note:

Will this eliminate the 8: Undefined index error or will it affect all error reports?

Advertisement: