SimplePortal
Support => English Support => Topic started by: leftezi on January 03, 2010, 09:51:05 AM
-
I have SMF 2.0 RC2 with SP 2.3.1 and getting very often this error in my error log:
8: Undefined offset: 1
file: ..... ..... /Themes/default/PortalAdminBlocks.template.php (eval?)
line: 32
In the line 32 is only a </tr>';
I have only one mod installed: the YouTube BBCode
-
Seeing as its an eval template error, the file/line given by php is not correct.
If you disable template eval, then you will get a real error message.
You can use the Disable Template eval mod to disable the use of eval in the templates: http://custom.simplemachines.org/mods/index.php?mod=2054
-
I don't know how save that is. So i installed this in my home test server that was producing the same error.
After the mod installation - activation the error look like this:
8: Undefined offset: 1
file: C:/wamp/www/Themes/default/Portal.template.php
line: 32
line 32 in this file is:
==>32:
<td id="sp_left"', !empty($modSettings['leftwidth']) ? ' width="' . $modSettings['leftwidth'] . '"' : '', $context['SPortal']['sides'][1]['collapsed'] && empty($modSettings['sp_disable_side_collapse']) ? ' style="display: none;"' : '', '>';
-
Just now i realized that this option is already installed in the SMF 2.0 RC2 version. There is no need for mod installation. Am i wrong?
In my home server the option appears twice after the mod installation. In the web-site appears only once without mod installation.
After the "disable template eval" option checked (in web server), the error look like this:
8: Undefined offset: 1
file: ... .../Themes/default/Portal.template.php
line: 32
line 32 in this file is:
==>32: <td id="sp_left"', !empty($modSettings['leftwidth']) ? ' width="' . $modSettings['leftwidth'] . '"' : '', $context['SPortal']['sides'][1]['collapsed'] && empty($modSettings['sp_disable_side_collapse']) ? ' style="display: none;"' : '', '>';
i think is the same with this in home server but i posted it anyway just in case.
-
That setting should not be there by default, its possible that your package manager made the edits twice. That can happen if you try to reload the page or if something else goes wrong.
Could you please attach your entire Themes/default/Portal.template.php file?
-
I have Greek language in SMF (i don't know if this plays some role).
Here is my file attached.
Thank you.
-
You mean the option to disable eval with the checkbox should not be there by derault?
In the web-site i have never installed the mod and this was there already!!
-
I can't think of a case which has index 1 unset. Can you attach your ./Sources/Subs-Post.php and ./index.php files here?
-
Here they are:
-
I was probably too tired after writing a long school paper, sorry. I actually need Subs-Portal.php file.
-
Ok, no problem. Thanks for your time.
Here is the Subs-Portal.php:
-
I see. Do you have blocks enabled when you are in the admin area?
-
Yes. They are enabled.
And i think you have right. The error in line 32 is produced when i am in the admin area and accessing in the block list.
-
Okay. I know what the issue is, but it would require quite a few changes to fix this. I'll file a bug report about this. I would suggest disabling blocks in admin areas until the next release.
-
Ah. I see.
About the block disabling in admin area:
Is there a danger for any damage or is recommended just to not produce the errors.
-
Nope, those errors won't cause any damage. It will just fill up your error log. You can disable blocks in certain areas through Admin > SimplePortal > Configuration > Block Settings area though.
-
Bug Report: http://simpleportal.net/index.php?issue=337.0
-
Ok, thank you.
-
My pleasure. ;)
-
Can you post the fix? :)
-
Why not just remove the array reset, [SiNaN]?
-
Can you post the fix? :)
I guess you could live without blocks in the admin areas until 2.3.2 or 2.4 version is relased, since I'm too lazy to post the necessary edits.
Why not just remove the array reset, [SiNaN]?
Array reset? You mean $context['SPortal'] = array(); in sportal_init() function? That won't change anything since sportal_init() is called before sportal_admin_block_list(). The issue is both functions use $context['SPortal']['sides'] index. The easiest way to fix this is to change the index used in the admin area.