OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJS theme setting reverting to default after being changed?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

OJS theme setting reverting to default after being changed?

Postby andrewImagine » Thu Dec 12, 2013 12:23 pm

Hello, OJS Community

I'm fairly new to OJS, but I promise I used the Advanced Search Page and checked the FAQ before posting. I didn't find anything which seemed to match the issue I am experiencing, so either I'm using the wrong search terms (entirely possible given my novice status with OJS) or my issue is relatively unique and novel. I'm hoping for the former, obviously.

I've got OJS (2.4.2) up and running successfully on our development server, with no issues. It's using the Blue Bar theme with some CSS modifications. We're very happy with the achieved result, and have taken steps to replicate on our staging server.

We also been able to deploy OJS on our staging server successfully, although we did have an issue (Bug #8151) between OJS and APC. Once we applied the recommended patch and restarted the web server, everything worked fine.

The weird part is when I try to select the Blue Bar theme from the Site Settings -> Site Theme drop down menu on our staging server. The theme appears in the drop down, I can select it, hit Save Changes and get the confirmation message that the setting change has been saved. The reloaded page gets the style sheet for the Blue Bar theme, so I know it's pulling the correct theme stylesheet information.

However, when I click any link (e.g. Home), the site appearance reverts back to the default theme-- as though I'd never selected Blue Bar theme from the Site Settings -> Site Theme dropdown. It's a very surreal experience, as I am sure you can imagine. No error message/feedback, nothing in the browser console log, just-- poof! Here's your default theme. (I can't post a link to the staging site, regrettably. It's behind an authentication process and I can't provide credentials.)

Based on my understanding of APC, it shouldn't be interfering with storing and retrieving settings from the database. Am I mistaken? Should I be looking for clues elsewhere? I appreciate any insight you would be willing to share.
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Thu Dec 12, 2013 12:30 pm

Hi andrewImagine,

Are you having trouble saving other OJS settings? If so, you might check the file permissions in your cache/ subdirectory.

Otherwise, check the "versions" table in your database to see if there's an entry for your theme. If not, you may need to run the upgrade script to register the plugin with your system. (Just in case, take a backup of your DB before you do this.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 13, 2013 9:19 am

Hi, Alec

Thanks for the quick reply. It's peculiar-- it seems I can change some settings without any issue (e.g. minimum number of characters in a password), but others will revert back right after a change (e.g. the name of the principal contact), much like what I've described with the theme.

The cache subfolder perms are set to 775, but the various files and folders within have 644 and 775 respectively. However, the web server account is the owner on all of them, so I'd think it would have sufficient access? I can try setting them wide open to 777, but that option will not be available for me on the production server.

I'll take a peek inside the "versions" table and see what I can find. Thanks again!
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 13, 2013 9:43 am

I've just looked at the versions table on both our staging server (where I'm having the issue) and our development server (where the new theme seems to be working fine) but I'm not seeing the blueBar theme as an entry on either database.

I am looking for a record with a product_type of plugins.themes and a product of blueBar, correct?
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Fri Dec 13, 2013 9:49 am

Hi andrewImagine,

Yes, it'll be something like that. Try running the upgrade script as I suggested above and see if that gets your version entry created. (If you upload the plugin through the Journal Manager's interface, it will also take care of creating the versions entry.)

As for your permission settings, you can use a quick PHP script to verify -- try calling is_writable('/path/to/cache-file'); and printing the result. Then ensure that everything is consistent with the permissions on that file. If you're using SELinux, be aware of those settings as well.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 13, 2013 11:54 am

I've confirmed the cache folder is writable. Backed up the database, and am reading up on the upgrade script now. Thanks again for the advice & insight.
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 13, 2013 2:11 pm

At first, I thought you were telling me to perform the upgrade from 2.4.2 to 2.4.3 (mea culpa), but as I was reading I came across the Installed=On/Off option in the config.inc.php file. I've executed the upgrade option from within the install, using the Installed=Off configuration option, and it's definitely added a plugins.themes/blueBar row to the versions table . . . but the original symptom (displays the new theme for one page, then reverts back to the default theme after that) still persists.
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Fri Dec 13, 2013 2:17 pm

Hi andrewImagine,

You're getting closer. Now the key is figuring out why you're unable to save settings; did you make any headway in debugging file permissions?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 13, 2013 2:43 pm

I've tested the cache folder with the is_writable function like you suggested, and it is returning true.

I can try changing the permissions on the cache folder and all subfolders to 777, but I won't be able to do that on the production server when this goes live.
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Fri Dec 13, 2013 2:46 pm

Hi andrewImagine,

If you delete all the .php files from cache/, do they get regenerated? (They should.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Mon Dec 16, 2013 10:46 am

Hi, Alec

Okay, finally had a chance to revisit this issue this morning and tried your suggestion with partial success.

Manually deleting the files in the cache folder and letting them rebuild seems to let the newly selected theme at the "site" level -- but now I can't get it to change over at the individual journal level. I've tried to change the theme for the individual journal, and deleting the cache again and letting it rebuild, but it doesn't seem to do the trick.

Is there a cache for the individual journals stored elsewhere? If so, do I just repeat the same kind of procedure?
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Mon Dec 16, 2013 11:09 am

Hi andrewImagine,

Journal settings are cached in the cache/ subdirectory too, in files called e.g. fc-journalSettings-1.php (where the 1 is the journal ID).

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 20, 2013 9:52 am

Hi, Alec

Okay, finally been able to return to this. I'm seeing the correct theme setting inside the fc-journalSettings-X.php file (i.e. blueBar), but the actual journal itself . . . trying to figure out how to explain this? It's like the default journal template has six css links, and after I select the new theme in the interface, I see seven css links (the last one being to the stylesheet in the blueBar theme folder), but when I click on a link to go anywhere else, I get a page with only six css links again and the seventh blueBar theme has been removed.

Is it possible the HTML of the header pre-compiled/cached in a different location, and that if I could clear that cache, the blueBar theme might stick on the pages of the individual journal?
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Re: OJS theme setting reverting to default after being chang

Postby asmecher » Fri Dec 20, 2013 11:22 am

Hi andrewImagine,

The behavior you're describing is consistent with the plugin being improperly registered with OJS. This is a combination of the plugin's class name, directory name, and the entry in the versions table. Have you altered any of these?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: OJS theme setting reverting to default after being chang

Postby andrewImagine » Fri Dec 20, 2013 12:43 pm

I haven't modified any php files, but I have modified the .css file and added a logo graphic inside the theme folder.

I'm not sure about the folder name. I'm seeing it matches the database entry, but appears to be different from the class name . . . unless the @brief line in the comment does something I'm not familiar with?

Here are the particulars, if that helps:

OJS Versions table contains: 1,0,0,0,2013-12-13 20:57:40,1,plugins.themes, blueBar,0,0

The folder name is: plugins/themes/blueBar

The class name is from a file called BlueBarThemePlugin.inc.php, I'm assuming:

/**
* @file BlueBarThemePlugin.inc.php
*
* Copyright (c) 2003-2008 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class BlueBarThemePlugin
* @ingroup plugins_themes_blueBar
*
* @brief "BlueBar" theme plugin
*/

import('classes.plugins.ThemePlugin');

class BlueBarThemePlugin extends ThemePlugin {
/**
* Get the name of this plugin. The name must be unique within
* its category.
* @return String name of plugin
*/
function getName() {
return 'BlueBarThemePlugin';
}
andrewImagine
 
Posts: 11
Joined: Thu Dec 12, 2013 11:48 am

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests