View Issue Details

This bug affects 2 person(s).
 16
IDProjectCategoryView StatusLast Update
18480Bug reportsTheme editorpublic2023-05-15 16:46
Reporterritapas Assigned Toollehar  
PrioritynormalSeverityblock 
Status closedResolutionno change required 
Product Version5.4.x 
Summary18480: User SurveyTheme could not be renamed
Description

this message appears when you try to rename a theme. The theme is actually not renamed.

System is linux, directory permissions as follows:
<code> ll -la
total 4
drwxrwx---+ 4 root apache 67 Nov 9 13:21 .
drwxrwx---+ 4 root apache 54 Nov 9 13:21 ..
drwxr-xr-x. 7 apache apache 91 Nov 9 13:21 extends_vanilla
</code>

apache has permission to write inside upload/themes/survey
<code>

sudo -u apache touch foo

sudo -u apache mv foo bar

sudo -u apache rm bar

</code>

Steps To Reproduce

Steps to reproduce

extend vanilla theme to e.g. 'extends_vanilla'.
enter the theme editor to modify it
try to rename it

Expected result

theme is renamed

Actual result

Error message: "Template could not be renamed to 'extends_vanilla2'. Maybe you don't have permission."
Theme is not renamed

TagsNo tags attached.
Attached Files
immagine.png (39,945 bytes)   
immagine.png (39,945 bytes)   
Bug heat16
Complete LimeSurvey version number (& build)5.4.7 (build 221019)
I will donate to the project if issue is resolvedNo
Browsern/a
Database type & versionmariadb-server-10.3.32-2
Server OS (if known)Red Hat Enterprise Linux release 8.5 (Ootpa)
Webserver software & version (if known)httpd-2.4.37-43
PHP Versionphp-7.2.24

Users monitoring this issue

ritapas

Activities

gabrieljenik

gabrieljenik

2022-11-09 14:35

manager   ~72683

That message appear when the "rename" command in PHP fails.
Maybe you can run the process again with debug=1 on the config.php file?

ritapas

ritapas

2022-11-09 14:44

reporter   ~72685

Hi, this is the error message which appears with debug enabled:

Thanks a lot for your reply

immagine-2.png (173,681 bytes)
DenisChenu

DenisChenu

2022-11-09 16:16

developer   ~72686

Same issue for me locally …
rename(copie_vanilla,copie_vanilla2): No such file or directory
sanitize_dirname : remove the / from Yii::app()->getConfig('userthemerootdir') . "/"

I take it

DenisChenu

DenisChenu

2022-11-09 16:35

developer   ~72687

https://github.com/LimeSurvey/LimeSurvey/pull/2715

I wait for tester to add another micro fix

DenisChenu

DenisChenu

2022-11-10 10:53

developer   ~72690

The fix is here : https://github.com/LimeSurvey/LimeSurvey/pull/2715/commits/3f286fd61b0e59d18646502788ef3b40afbc8b97

All after are :

  • Remove returnGlobal usage
  • reorganize test : check and redirect or throw error
  • Check if old template directory is already a Theme
  • etc
ollehar

ollehar

2023-05-15 16:30

administrator   ~74979

Already fixed or something.

ritapas

ritapas

2023-05-15 16:43

reporter   ~74980

sorry, since which version?

DenisChenu

DenisChenu

2023-05-15 16:46

developer   ~74981

https://github.com/LimeSurvey/LimeSurvey/commit/f18310cf00044d2031af2bfd5cf344ea80df1b94 for 5X
PS : https://github.com/LimeSurvey/LimeSurvey/pull/3077
and
https://github.com/LimeSurvey/LimeSurvey/commit/1337418e4a02e3a8be83f0740912e89a39dec0c5 for 6.X

Issue History

Date Modified Username Field Change
2022-11-09 13:40 ritapas New Issue
2022-11-09 13:40 ritapas File Added: immagine.png
2022-11-09 13:46 ritapas Issue Monitored: ritapas
2022-11-09 13:46 ritapas Bug heat 0 => 2
2022-11-09 14:35 gabrieljenik Note Added: 72683
2022-11-09 14:35 gabrieljenik Bug heat 2 => 4
2022-11-09 14:35 gabrieljenik Status new => acknowledged
2022-11-09 14:44 ritapas Note Added: 72685
2022-11-09 14:44 ritapas File Added: immagine-2.png
2022-11-09 14:44 ritapas Bug heat 4 => 6
2022-11-09 15:43 guest Bug heat 6 => 12
2022-11-09 16:16 DenisChenu Note Added: 72686
2022-11-09 16:16 DenisChenu Bug heat 12 => 14
2022-11-09 16:17 DenisChenu Assigned To => DenisChenu
2022-11-09 16:17 DenisChenu Status acknowledged => confirmed
2022-11-09 16:18 DenisChenu Priority none => normal
2022-11-09 16:35 DenisChenu Status confirmed => assigned
2022-11-09 16:35 DenisChenu Note Added: 72687
2022-11-09 16:37 DenisChenu Summary Template could not be renamed to 'xxx'. Maybe you don't have permission. => User SurveyTheme could not be renamed
2022-11-10 10:53 DenisChenu Note Added: 72690
2022-11-10 10:54 DenisChenu Assigned To DenisChenu =>
2022-11-10 10:54 DenisChenu Status assigned => ready for code review
2023-05-15 16:30 ollehar Assigned To => ollehar
2023-05-15 16:30 ollehar Status ready for code review => closed
2023-05-15 16:30 ollehar Resolution open => no change required
2023-05-15 16:30 ollehar Note Added: 74979
2023-05-15 16:30 ollehar Bug heat 14 => 16
2023-05-15 16:43 ritapas Note Added: 74980
2023-05-15 16:46 DenisChenu Note Added: 74981