View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18085Bug reportsAssetspublic2022-07-11 11:24
Reportermhladun Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version5.3.x 
Fixed in Version5.3.x 
Summary18085: Renamed custom theme not updated in global survey settings
Description

I have a custom theme, ABC, that extends bootswatch/vanilla. After renaming it using the Theme Editor, to ABC2, it is correctly saved in the database table lime_global_settings as stg_value = 'ABC2' where stg_name = 'defaulttheme', however, the global survey settings theme is not updated to the ABC2 automatically. And so if I go to begin a survey, I end up getting a PHP Warning like

Undefined property: TemplateConfiguration::$options
C:\nginx-1.20.1\html\limesurvey\application\models\TemplateConfiguration.php(1510)
1504 ... if (in_array($name, $aAttributesThatCanBeInherited) && $this->bUseMagicInherit) {
1505 // Full inheritance of the whole field
1506 $sAttribute = parent::__get($name);
1507 if ($sAttribute === 'inherit') {
1508 // NOTE: this is object recursive (if parent configuration field is set to inherit,
1509 // then it will lead to this method again.)
1510 $sAttribute = $this->getParentConfiguration()->$name; // <---------------------------- error here
1511 }
1512 } else { ...

To fix this, I have to manually go and set Theme = ABC2 in Configs -> Global survey -> Theme. I find it reverts to bootswatch each time I rename a child theme.

Not a huge issue, but it might bother others.

Steps To Reproduce

Steps to reproduce

Rename a theme using the Theme Editor.
Go begin a survey

Expected result

No PHP warning is thrown, and the theme is applied to the survey.

Actual result

The PHP warning, described above, is thrown.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)5.3.10 220419
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionPostgresql, EnterpriseDB 10.9.17
Server OS (if known)Windows
Webserver software & version (if known)NGINX
PHP VersionPHP 8, php-cgi

Users monitoring this issue

There are no users monitoring this issue.

Activities

mhladun

mhladun

2022-05-05 21:02

reporter   ~69442

Sorry about the duplicate issues everyone. I was getting an error saying a Discord plugin was not working, and that I should go back and revise my issue and resubmit it.

gabrieljenik

gabrieljenik

2022-05-06 00:29

manager   ~69447

Removed the duplicates

gabrieljenik

gabrieljenik

2022-05-06 00:31

manager   ~69448

This happens when you rename the default theme, right?

DenisChenu

DenisChenu

2022-05-06 08:39

developer   ~69451

Undefined property: TemplateConfiguration::$options

debug > 0 ?

This happen a lot of time in 1st laod, if you reload survey (2 times) : it don't work ?
Seems the autofixer happen after …

gabrieljenik

gabrieljenik

2022-05-06 15:16

manager   ~69473

To fix this, I have to manually go and set Theme = ABC2 in Configs -> Global survey -> Theme. I find it reverts to bootswatch each time I rename a child theme.

This is interesting

mhladun

mhladun

2022-05-06 16:00

reporter   ~69482

Gabriel,
It happens when I rename my custom theme (an extension of bootswatch/vanilla). This custom theme is set as the default theme, yes. And I don't have any other themes installed, only vanilla, bootswatch, and my one custom theme.

Denis,
Yes, debug = 2.
I've tried loading the page multiple times. When I go to Configs -> Global survey -> Theme, I see it's set to bootswatch.

gabrieljenik

gabrieljenik

2022-05-06 16:06

manager   ~69483

The bug for me is: "When you rename a theme, which is the default, the defauls theme setting is not properly updated".
I would try to reproduce it and confirm it following that pattern.

mhladun

mhladun

2022-05-06 16:08

reporter   ~69484

That's a good way of phrasing it, thanks. Is there a way for me to edit the issue to add that?

DenisChenu

DenisChenu

2022-05-06 16:34

developer   ~69487

Hi,

Thanks for feedback, about reloading : i have to check exactly how it can be reproducible … maybe with Theo of group too …
But something that happen only one time it's hard to debug.

Without debug : you have a broken theme (bas css/js) 2 times.

mhladun

mhladun

2022-05-06 16:41

reporter   ~69488

Denis, setting debug to 0, I receive a page stating,

500: Internal Server Error
Invalid <old_template_name> template directory
An internal error occurred while the Web server was processing your request.

mhladun

mhladun

2022-05-06 16:41

reporter   ~69489

I also tried refreshing multiple times and get the same error.

gabrieljenik

gabrieljenik

2022-05-20 20:56

manager   ~69941

When renaming a theme, the surveys are updated, and the defaults (the default at the global settings level).
But the groups are not updated (neither the normal ones nor the 0, which is the one in the global survey settings). That is fixed here.

gabrieljenik

gabrieljenik

2022-07-06 08:29

manager   ~70758

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=33631

LimeBot

LimeBot

2022-07-11 11:24

administrator   ~70827

Fixed in Release 5.3.24+220711

Related Changesets

LimeSurvey: master 3706e7da

2022-07-06 08:29:34

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 18085: Renamed custom theme not updated in global survey settings (#2436) Affected Issues
18085
mod - application/models/Template.php Diff File

Issue History

Date Modified Username Field Change
2022-05-05 21:00 mhladun New Issue
2022-05-05 21:02 mhladun Note Added: 69442
2022-05-05 21:02 mhladun Bug heat 0 => 2
2022-05-06 00:29 gabrieljenik Note Added: 69447
2022-05-06 00:29 gabrieljenik Bug heat 2 => 4
2022-05-06 00:31 gabrieljenik Note Added: 69448
2022-05-06 08:39 DenisChenu Note Added: 69451
2022-05-06 08:39 DenisChenu Bug heat 4 => 6
2022-05-06 15:16 gabrieljenik Note Added: 69473
2022-05-06 16:00 mhladun Note Added: 69482
2022-05-06 16:06 gabrieljenik Note Added: 69483
2022-05-06 16:08 mhladun Note Added: 69484
2022-05-06 16:34 DenisChenu Note Added: 69487
2022-05-06 16:41 mhladun Note Added: 69488
2022-05-06 16:41 mhladun Note Added: 69489
2022-05-09 17:10 gabrieljenik Assigned To => gabrieljenik
2022-05-09 17:10 gabrieljenik Status new => assigned
2022-05-09 17:10 gabrieljenik Status assigned => new
2022-05-16 22:06 gabrieljenik Status new => confirmed
2022-05-20 20:56 gabrieljenik Status confirmed => ready for testing
2022-05-20 20:56 gabrieljenik Note Added: 69941
2022-05-20 21:01 gabrieljenik Issue cloned: 18138
2022-07-05 15:21 gabrieljenik Assigned To gabrieljenik => DenisChenu
2022-07-05 15:21 gabrieljenik Status ready for testing => ready for code review
2022-07-06 08:29 gabrieljenik Changeset attached => LimeSurvey master 3706e7da
2022-07-06 08:29 gabrieljenik Note Added: 70758
2022-07-06 08:29 gabrieljenik Assigned To DenisChenu => gabrieljenik
2022-07-06 08:29 gabrieljenik Resolution open => fixed
2022-07-06 08:38 DenisChenu Status ready for code review => resolved
2022-07-06 08:38 DenisChenu Fixed in Version => 5.3.x
2022-07-11 11:24 LimeBot Note Added: 70827
2022-07-11 11:24 LimeBot Status resolved => closed
2022-07-11 11:24 LimeBot Bug heat 6 => 8