News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Re: Undefined index: actual_theme_dir

Started by AllMassive, March 20, 2021, 01:15:01 AM

Previous topic - Next topic

AllMassive

i'm using the default theme with smf 2.0.19, initially installed 1.x and upgrading it since.
i get this error when someone tries to register on the forum.
installed languages are german and english.
i do have this Lang Drop Down-Mod installed.

shadav

split your post from that topic...

it's always best to start your own support topic, especially since that topic was about a specific theme

can you please post the entire error from your log, showing what file it is from and what line

I just checked the lang drop down mod and actual_theme_dir is not in it's code

you updated from 1.x, how did you update?

what all mods do you have installed?

and I'm assuming that you meant 2.0.18

Aleksi "Lex" Kilpinen

#2
That error is annoying, and I believe it is in part caused by the drop down being used to override language settings.
It doesn't break anything, it's not an issue as such - but it is annoying.
I am not 100% sure of the actual cause, but I believe it is something along the lines that language should be loaded before the theme is, and the drop down reverses this order when used.
I'm familiar with this error myself, saw it periodically on my own 2.0 forum.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

AllMassive

Quote from: shadav on March 20, 2021, 04:10:40 AM
can you please post the entire error from your log, showing what file it is from and what line

https://forum/index.php?pretty;action=login2
8: Undefined index: actual_theme_dir
Datei: /var/www/clients/client1/web1/web/Sources/Load.php
Zeile: 2283


Line 2283: $settings['default_theme_dir'] . '/languages',
// Default language directories to try.
                $language_directories = array(
                        $settings['default_theme_dir'] . '/languages',
                        $settings['actual_theme_dir'] . '/languages',
              );
 

Quote from: shadav on March 20, 2021, 04:10:40 AM
you updated from 1.x, how did you update?
i used the built-in update packages since the initial install +10 years ago.
during that time i installed/uninstalled a lot of mods, but all without errors.

Quote from: shadav on March 20, 2021, 04:10:40 AM
what all mods do you have installed?


Name der Modifikation Mod Version
1. Restrict Email Providers on Registration 1.2
2. SMF 2.0.18 Update 0.1.0
3. Avatar Drop Shadows 1.0
4. Login Security 1.0.4
5. IPv6 Support 1.0.1
6. Pretty URLs 2.4
7. Users Online Today 2.0
8. More Spiders 1.2
9. View Only Boards 1.2c
10. Simple Audio Video Embedder 6.0.3c
11. Unknown Actions 1.4
12. SMF Arcade 2.6.4
13. Sorted Package Manager Listing 1.2
14. Hilbert 1.0
15. Logout Prompt 1.0
16. Login Form Fix 1.0
17. Language Drop Down 1.5.3
18. Auto Twitter Embed 2.0
19. URL Popup 1.0.2
20. EU Cookie 1.2
21. Search Focus Dropdown 1.6.1
22. Gamer IDs 1.4


Quote from: shadav on March 20, 2021, 04:10:40 AM
and I'm assuming that you meant 2.0.18
Correct

shadav

Quote from: Aleksi "Lex" Kilpinen on March 20, 2021, 04:25:31 AM
That error is annoying, and I believe it is in part caused by the drop down being used to override language settings.
It doesn't break anything, it's not an issue as such - but it is annoying.
I am not 100% sure of the actual cause, but I believe it is something along the lines that language should be loaded before the theme is, and the drop down reverses this order when used.
I'm familiar with this error myself, saw it periodically on my own 2.0 forum.

you are correct, since they updated from 1.x I looked at the mods code from 1.x and actual_theme_dir is in there


so this is a case of using an outdated 1.x mod on a 2.x forum

uninstall the language drop down mod, download the latest version and reinstall it

probably need to check other mods you had installed back on 1.x and update them as needed as well


Aleksi "Lex" Kilpinen

#5
In this case, it's likely that it's either theme specific issue (easy to check, see if the problem goes away when using Curve), or a small bug in the way 2.0 checks for that theme variable, brought visible by the mod (also can be checked, if removing the mod stops the errors then I'm probably right) - I'm not sure if the mod could completely fix that even if they tried though.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

shadav

i think you were correct at fist that the mod is causing the issue

if you look at the code for the mod for 1.1.2

in source/load it is adding the code in question

however in the code for the mod for 2.x that code was removed/changed (actually the mod was completely rewritten for 2.x)

Aleksi "Lex" Kilpinen

Alright! Could be - I haven't checked that mod in ages. It's worth checking if an updated version fixes that :)
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

shadav

:) it should...I downloaded the mod and compared the two files together after you mentioned you'd seen this issue with the mod before which made me think since they updated from 1.x to 2.x maybe some things had changed, and sure enough it has....

the old 1.x version of the mod added the code with the actual_theme_dir in it, whereas the newer 2.x version of the mod rewrote everything and no longer uses that bit

so actual_theme_dir seems to be something that 1.x used whereas 2.x no longer does

AllMassive

i uninstalled this mod and the error didnt occur anymore. then reinstalled it, after downloading 'the newest' version, since i already had the latest 1.5.3 installed before.
after that the error still occurs.

Quote from: shadav on March 20, 2021, 04:03:04 PM
the old 1.x version of the mod added the code with the actual_theme_dir in it, whereas the newer 2.x version of the mod rewrote everything and no longer uses that bit
so actual_theme_dir seems to be something that 1.x used whereas 2.x no longer does

i think i dont understand that sentence, but i downloaded the Full 2.0.18-Package to checked for actual_theme_dir - it already exists.

grep -r actual_theme_dir
Themes/default/languages/Themes.english.php:$txt['actual_theme_dir'] = 'This theme\'s directory: ';
Themes/default/Themes.template.php: <label for="theme_dir">', $txt['actual_theme_dir'], '</label>
Themes/default/Themes.template.php: <input type="text" id="theme_dir" name="options[theme_dir]" value="', $context['theme_settings']['actual_theme_dir'], '" size="50" style="max-width: 100%; width: 50ex;" class="input_text" />
Sources/Load.php: $settings['actual_theme_dir'] = $settings['theme_dir'];
Sources/Load.php: $settings['actual_theme_dir'] . '/languages',
Sources/Subs.php: $settings['theme_dir'] = $settings['actual_theme_dir'];
Sources/ManageServer.php: $backup_actual_theme_dir = $settings['actual_theme_dir'];
Sources/ManageServer.php: $settings['actual_theme_dir'] = $settings['base_theme_dir'] = $settings['default_theme_dir'];
Sources/ManageServer.php: $settings['actual_theme_dir'] = $backup_actual_theme_dir;

shadav

meh what do i know  :laugh:
I was just looking at the language mod
and in the 1.x version of the mod that line was there in the 2.x version of the mod it was not
so was just guessing that that was something related to smf 1.x, but seems it's not

however if uninstalling the mod stopped the error, then most likely it is something to do with that mod

Aleksi "Lex" Kilpinen

#11
Yeah, in simple terms - as I am a simple man, and not very good with the actual code side of things - My understanding is that the variable in itself is a default SMF theme setting,
and so the error could be caused by a theme that doesn't have it properly defined, or a mod that accidentally helps SMF to "forget" that it is defined. This is what I was trying to say earlier.
We have seen this error come up randomly before, and it is my understanding that 2.1 did change something in the way this is handled in an attempt to stop this from happening.

Edit:
Continuing with this, still - not a coder here - I do kinda wonder why the mod doesn't just utilize the built in option of changing languages on the fly, or does it?
I mean if it just redirected you to a language call like http://simplemachines.org/community/index.php?language=finnish-utf8 it shouldn't cause this issue.
Granted, that also redirects you to the forum index - but is that a big price to pay? Unless that is, if the error stems from earlier in the functionality while setting up the languages available..
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Aleksi "Lex" Kilpinen

You could try something like this to get rid of the error, if it is not causing any other issues for you than filling the log

Quote from: Arantor on September 16, 2014, 07:39:46 PM
It's not related to a txt string. It's looking for a $settings entry.

I've seen this before, usually on themes that aren't set up properly internally but I've never been able to definitely nail it down before.

Easy fix:
Code (find) Select
$language_directories = array(
$settings['default_theme_dir'] . '/languages',
$settings['actual_theme_dir'] . '/languages',
);


Code (replace) Select
$language_directories = array(
$settings['default_theme_dir'] . '/languages',
);
if (!empty($settings['actual_theme_dir']))
$language_directories[] = $settings['actual_theme_dir'] . '/languages';


Could even roll that into the base distribution to prevent this being an issue in future. (This has been done already in 2.1, and I know this because I did it albeit slightly differently there. This commit for the curious.)
I'm thinking, if the error is actually triggered when checking for the languages - and not when changing them, then this might work.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

AllMassive

Quote from: Aleksi "Lex" Kilpinen on March 21, 2021, 06:50:18 AM
You could try something like this to get rid of the error, if it is not causing any other issues for you than filling the log
I'm thinking, if the error is actually triggered when checking for the languages - and not when changing them, then this might work.

Nice - this one works - thank you for finding it in the forum, since i searched also and didnt find.

Aleksi "Lex" Kilpinen

Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: