[Help] OJS malfunctioning after removeing the theme folder

Dears,

I set the OJS theme to a new theme (themeX) in the ojs/manager/setup/5 and also in the ojs/admin/settings.
It was working fine.

Then I was trying to update the theme, for that, I deleted the themeX folder from the ojs/plugins/themes folder, and instead created a fresh new folder under the same name (themeX), and put the updated theme files there.

After that, OJS is not working properly, i…e I cannot open pages: ojs/manager/setup/5 and page ojs/admin/settings to modify the look of the journal anymore. On accesing these two pages, nothing shows at all, just a blank page. Everything else (as far as I can tell) is working properly. I can even access other setup pages, such as ojs/manager/setup/4.

I tried clearing the data cache and the theme cache from the admin menue. but it did not help.

I have a backup of the server (not the OJS). How can I correct this issue? Should I restore the OJS files? Which folder? Or should I restore the OJS database? how?

OJS version 2.4.5.0

Thanks.

[edit] I also noticed that the page ojs/manager/plugins is also not accessible.

There is probably a PHP error in your new theme. You’ll want to look in your error logs to see where it is failing. See this FAQ:

Restoring the original theme files probably will get you up and running again quickly if desired; it’s unlikely there’s any database restore needed at this point.

1 Like

Thanks for reply.

No the theme is fine. I was using it before with no problem, and even now it is working fine in rest of the pages.

the error log reads as: “PHP Fatal error: Cannot redeclare class themeXThemePlugin”.

I guess it was a permission error.
anyway, I restored a previous backup of the ojs folder and the problem was solved.

The PHP error indicates that OJS was finding two classes identically named as “themeXThemePlugin”. This could occur if the original theme was still present in another folder.

1 Like

Can it be that the themeX folder was also in the cache folder and hence causing the error?
if yes, how can I clean cache in the future?
I tried deleting the cache folder, but it crashed OJS completely.

I tried CLEAR DATA and CLEAR CACHE options from within the ojs, but it did not help in the case of this issue.

I’m not aware of any native functionality that would create a copy of the class in the cache directory.

To find the offending file(s) if this were to happen again, use a search tool such as grep to look for the duplicate class definitions:
grep -r 'class themeXThemePlugin extends ThemePlugin' plugins/themes/

Using the options in OJS to clear the cache is appropriate. If you were to run across a situation where you needed to clear the cache without access to the UI, you could remove the files from the cache directory and subdirectories, leaving the directory structure intact.

1 Like