Closed hartenthaler closed 1 year ago
"colorful (white/blue/bootstrap.min.css" - means you are using the old version of the theme (as this palette is not present in the latest version of the theme). Wipe out the entire old theme directory and add the new theme directory.
I added to the directory name of the existing modern theme ".disable". Then copied the new module to another (new) directory "modules_v4/webtrees-theme-modern2" which results in the above error.
keeping the old theme in the modules_v4 folder will still load the theme, even when renaming. Move the old theme out of the webtrees directory structure and try again.
BTW - I am about to upload a release of the "Life Story" tab module with language translation (English, Spanish, and German to start). I'll announce in the webtrees community and tag you.
I have deleted now both modern directories. Uploaded only the new modern theme, but the error is the same.
I'm curious about the new "Life Story" and can support you by translating it into German.
Try this:
In "modules_v4/webtrees-theme-modern/resources/css/palettes" there are two subfolders "bootswatch" and "modern". Is the folder "bootswatch" needed? There is no "modules_v4/webtrees-theme-modern/resources/css/palettes/colorful.
You need to delete the entire module (not just the subfolders or files in the module). So for you, I think you need to delete:
Then follow my instructions above
I deleted the entire module (both folders modern and moden2). I followed the instructions and deleted preferences for modern and modern2. Copied the folder again to the webtrees server. And the error is there again.
I worry when you say "copied the folder again", you copied old theme files (or you are mixing new theme files with old ones - like you customized a file in the old them and are trying to use it in the new theme).
Can you reply with a screenshot of the "folder" showing every folder, file, and file size?
I just downloaded https://github.com/JesseWebDotCom/webtrees-theme-modern/releases/download/0.0.1/webtrees-theme-modern.0.0.1.zip again from your release. I did not mixed up anything. I copied only the new folder with the new modern theme to the server. There is no old version there.
Looks good. According to the error, your problem is here: /mnt/web109/a3/99/51547399/htdocs/hermann/hartenthaler/php/webtrees/modules_v4/webtrees-theme-modern2/ModernTheme.php
Which is likely the old theme file. Are you able to access that directory and delete the files? If not, sounds like you are using an external provider to host webtrees and there's a caching issue going on.
Maybe also try deleting the files, restarting your web server, adding the files, and testing again.
BTW (and unrelated to this issue) - you can test out the preview release of the Life Story tab (I added German translations): https://www.webtrees.net/index.php/en/forum/4-customising/38105-new-tab-life-story
And according to chatgpt (I have not tested these recommendations nor do I know if they are safe/valid):
I have deleted now in another of my webtrees installations the existing modern theme. In the control panel, I have deleted the settings for this module. Copied the new module folder to the server. The error is there in this environment, too. It is not a cache problem and it is not a file permission problem.
I out-commented the line #252 in ModernTheme.php ($files[] = $this->assetUrl($file);). Now the error disappeared. But the functionality is gone, too.
I wanted to try this theme out of curiosity, but got the same error message as a logged in user. Without logging in I did get a working theme.
It took some digging in the code (largely a copy of the justlight theme so not too hard for me to read) and I found the culprit.
To get rid of this error message you have to manually remove the modern-palette setting from the table wt-user-setting in the database.
@JustCarmen - thanks. that's problematic but only for users of the old theme. any suggestions on how to do this in the theme so users do not have to dig into the database?
Not tested but I think this should work:
In the function palette you have this code:
// If we are logged in, use our preference
$palette = Auth::user()->getPreference('modern-palette', '');
After that put this code:
if (!in_array($palette, $this->palettes())) {
// remove the remaining setting from the old theme
DB::table('user_setting')->where('setting_name', '=', 'modern-palette')->delete();
}
This additional code does the trick. Thank you, @JustCarmen
The new themes are looking great now. Thank you, @JesseWebDotCom
I like the modern theme! Especially the new Ancestry theme looks familiar.
Closing as this only applies to people who had the old theme