tingobol / yii-rights

Automatically exported from code.google.com/p/yii-rights
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Wrong theme is applied when running a controller inside a module #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Insert rights module into _another module_
2. Run the application with configured rights
3. Wrong theme is applied when running a controller inside a module

I used theme / module so when I installed Rights, It always set theme to 
another module's theme.

The problem comes from Rights::module() where in it iterates over every modules 
if rights wasn't inserted into the main app. So it creates those modules whose 
weren't created before, overwriting current theme.

Rights::module() is used heavily.

Original issue reported on code.google.com by attila.s...@gmail.com on 3 Mar 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Well, workaround is not to include theme setting into module->init(), indlue it 
into beforeControllerAction.

So no need to fix this

Original comment by attila.s...@gmail.com on 3 Mar 2012 at 11:06

GoogleCodeExporter commented 9 years ago
Which file is beforeControllerAction located in ? 

Just include the following line ?

Yii::app()->theme = 'installed_theme_name';

Original comment by gricedus...@gmail.com on 3 May 2013 at 11:29

GoogleCodeExporter commented 9 years ago
I got the same problem. How do I apply a custom theme to Rights module.

Original comment by ratta...@gmail.com on 29 Oct 2013 at 6:40

GoogleCodeExporter commented 9 years ago
You should change
public $appLayout = 'application.views.layouts.main';
to
public $appLayout = '//layouts/main';

in
RightsModule.php

to get it work.

Original comment by szigyar...@gmail.com on 22 Dec 2013 at 1:05