View Issue Details

This bug affects 2 person(s).
 14
IDProjectCategoryView StatusLast Update
18480Bug reportsTheme editorpublic2022-11-10 10:54
Reporterritapas Assigned To 
PrioritynormalSeverityblock 
Status ready for code reviewResolutionopen 
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.
Bug heat14
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

User List ritapas

Activities

ritapas

ritapas

2022-11-09 13:40

reporter  

immagine.png (39,945 bytes)   
immagine.png (39,945 bytes)   
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

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