Skip to content
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

[Bug]: Theme not saved in session with modules/profile #1514

Open
koreus opened this issue Feb 4, 2025 · 3 comments
Open

[Bug]: Theme not saved in session with modules/profile #1514

koreus opened this issue Feb 4, 2025 · 3 comments

Comments

@koreus
Copy link

koreus commented Feb 4, 2025

XOOPS Version

2.5.12 beta4

PHP Version

8.3

Operating System

Linux

Description

Hi,

When I change the theme in the profile (with modules/profile installed), and save, the new theme is saved in database but not in session.
So Xoops still displays the old theme.
On file /modules/profile/edituser.php , line 85 . I change :
unset($_SESSION['xoopsUserTheme']);
To :
$_SESSION['xoopsUserTheme']=$edituser->getVar('theme');

It works for me and the change takes effect immediately.
Is there any reason for the unset ?

Steps to Reproduce

With module profile installed :

  • Edit profile
  • Change current theme to another (you must have enabled multiple themes choice in system preferences)
  • Save
  • The theme doesn't change but if you go back in your profile, it is.
@mambax7
Copy link
Collaborator

mambax7 commented Feb 4, 2025

The easiest way to switch themes instantly is to activate the "Themes" block from the system:

Image

make it visible to groups that you want to be able to switch themes,

Image

and then you can test various themes right there:

Image

I guess, the original Core developers didn't see it as critical or didn't have time for it. If you fix it, please submit a PR for it

Thanks!

@koreus
Copy link
Author

koreus commented Feb 4, 2025

I have pushed a new commit in the patch1 PR 20b746f

Should I have submitted a new PR ? I'm stil learning :)

@koreus
Copy link
Author

koreus commented Feb 5, 2025

I found out why the theme was not saved in session

function themeSelect() in xoopskernel.php handles it. It expects a $_POST['xoops_theme_select'].
But the form in modules/profile/edituser.php send a $_POST['theme'].
To correct this, we have to replace theme by xoops_theme_select in the column field_name in table xoops_profile_field .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants