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

Custom theme not work on OJS 3.1.2 #4600

Closed
navotera opened this issue Mar 14, 2019 · 11 comments
Closed

Custom theme not work on OJS 3.1.2 #4600

navotera opened this issue Mar 14, 2019 · 11 comments
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.

Comments

@navotera
Copy link

I have done a fresh install the OJS 3.1.2 on my localhost before doing some update to the production site.

Seem like OJS 3.1.2 failed when load the custom smarty template files. It always use the default layout provided by pkp library for any page although the custom layout provided in the plugin/themes/custom_theme/templates.

I try another theme, such as NateWr Boostrap 3 theme, HealthSciences, however, the problem still persists.

I had cleared the cache and still not work out.

here the preview of healthsciences index page (only css loaded).
image

and this is the error (when i activate display error on config.inc.php), but I guess this is not related to this problem.
image

@Vitaliy-1
Copy link
Collaborator

Hi @navotera,

OJS 3.1.2 included an update from Smarty 2 to 3 that requires minor changes in syntax. Regarding Health Sciences theme, it's already updated, you can view the latest commits there to get yourself familiarized with needed changes, starting from 4th of March: https://github.com/pkp/healthSciences/commits/master

@navotera
Copy link
Author

Thank for your reply sir.

Yes I know that there update on smarty and I try the latest (claimed supported for OJS 3.1.2 by you as the author of the theme).

I am not sure since your theme is work flawlessly on the previous version 3.1.1 (with the right version of your theme) but all the theme is not work (except the default which is not using any of custom template).

I tried for two computer and it both not work.
My enviroment is :
php 7.1.16
apache server
window 10

Can you give me a guide which of this PKP lib source code that loads the theme, so I can evaluate it myself?

@Vitaliy-1
Copy link
Collaborator

I cannot reproduce the problem that you are describing, e.g., I've activated Health Science on OJS 3.1.2 right now with no issues. Can you confirm that the latest release of Health Science theme and Bootstrap 3 theme is not working properly? If they are not working, can you specify the error in PHP logs?

If you are not sure if there is an error, it's better to open a topic on the forum.

Can you give me a guide which of this PKP lib source code that loads the theme, so I can evaluate it myself?

There are many classes involved in all levels of processing. I'm not sure what you want to accomplish but the class that extends Smarty functionality is PKPTemplateManager

@navotera
Copy link
Author

navotera commented Mar 17, 2019

Yes it does not work on windows 10

But work on my Ubuntu, seems like there some problem with path on the _overridePluginTemplates on file /pkp/classes/Plugin.inc.php

on Ubuntu it return :
plugins/themes/healthSciences/templates/frontend/pages/indexJournal.tpl

on windows it return :
plugins/themes/healthSciences\templates\frontend\pages\indexJournal.tpl

I tried to fix the slash symbol on windows but seem like it does not work, not sure which file and line that has some function that would choose which template file that would load to the user?

Can you make these issues open again?

@Vitaliy-1 Vitaliy-1 reopened this Mar 17, 2019
@Vitaliy-1
Copy link
Collaborator

Thanks @navotera

Confirming this; requires further examination.

@Vitaliy-1
Copy link
Collaborator

On first glance lib-pkp prefix should be fixed to be compatible with Windows directory separator (e.g. "lib" . DIRECTORY_SEPARATOR . "pkp" . DIRECTORY_SEPARATOR): https://github.com/pkp/pkp-lib/blob/master/classes/plugins/Plugin.inc.php#L389

Vitaliy-1 added a commit to Vitaliy-1/pkp-lib that referenced this issue Mar 18, 2019
@Vitaliy-1
Copy link
Collaborator

pkp-lib master: #4610
@asmecher, can you take a look?

@Vitaliy-1 Vitaliy-1 added the Bug:1:Low A bug that does not have a severe consequence or affects a small number of users. label Mar 18, 2019
@navotera
Copy link
Author

it works with you code :
$libPkpPrefix = 'lib' . DIRECTORY_SEPARATOR . 'pkp' . DIRECTORY_SEPARATOR;

is this official ?

asmecher added a commit that referenced this issue Mar 19, 2019
#4600 update directory separator to override template file…
asmecher pushed a commit that referenced this issue Mar 19, 2019
@asmecher
Copy link
Member

Merged f87a87d and cherry-picked to stable-3_1-2. Thanks, @Vitaliy-1!

@navotera
Copy link
Author

navotera commented May 7, 2019

the official download of ojs 3.1.2 not work (this code never merge to the official OJS download https://pkp.sfu.ca/ojs/ojs_download/)

@asmecher
Copy link
Member

asmecher commented May 7, 2019

@navotera, this is filed against the 3.1.2-1 milestone, which has not been released yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Projects
None yet
Development

No branches or pull requests

3 participants