-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This fix broken language selection in admin -> settings. #28
base: master
Are you sure you want to change the base?
Conversation
admin/admin_settings.php
Outdated
@@ -119,11 +123,14 @@ | |||
|
|||
$q = db_select("select * from brugere where brugernavn = '$brugernavn'",__FILE__ . " linje " . __LINE__); | |||
$r = db_fetch_array($q); | |||
if ($brugerId=$r['id']) { | |||
/** The following test is always false as this is the only occurence of $brugerId in the entire codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable bruger_id exsists, however the variables that get created don't seem to be called anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I have misread the if statement as a comparison. But now I see it is an assignment to $brugerId
.
In this case, a more readable code would be just isset($r['id']
as it is doing nothing more. And $brugerId
is not used anywhere else
@@ -100,10 +101,13 @@ | |||
} | |||
update_settings_value("nyhed", "dashboard", $newssnippet, "The news snippet showen to all admin accounts on this system"); | |||
db_modify($qtxt,__FILE__ . " linje " . __LINE__); | |||
$qtxt="update settings set var_value='$languageId' where var_name='languageId'"; | |||
$qtxt="update settings set var_value='$languageId' where var_name='language_id'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the logic behind changing languageId to language_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic being that language_id
is the value set in the table field var_name
:-)
See here:
Lines 272 to 273 in 377e1dc
$qtxt = "insert into settings(var_name,var_grp,var_value,var_description,user_id) values "; | |
$qtxt.= "('language_id','globals','0','Active systemlanguage','0')"; |
0074ec9
to
c0b6cb0
Compare
I just need to run this though Peter before we can pull the PR |
This shouldn't be merged before #26, see comment just now. |
c0b6cb0
to
6a6b5d6
Compare
Together with new function get_root() it is ensure, that the cookie 'languageId' is set across the entire app folder, not individual subfolders, i.e. index/ and admin/ Also minor correction and highlighted questions.
6a6b5d6
to
6d4d3f2
Compare
What are the changes about?
This fix broken language selection in admin -> settings.
Together with new function get_root() it is ensure, that the cookie 'languageId' is set across the entire app folder, not individual subfolders, i.e. index/ and admin/
Also minor correction and highlighted questions.
Have you checked the following?
https://docs.google.com/document/d/1GOmomtvKf21OV2VWNOIPweDi4gJHpMCK5qXzrPrypUc/edit?usp=sharing