View Issue Details

IDProjectCategoryView StatusLast Update
13750Bug reports[All Projects] Survey designpublic2018-06-27 15:29
ReporterJohn_KAssigned Toc_schmitz 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.8.x 
Target VersionFixed in Version 
Summary13750: (PHP warning)Set template permission for this user- Error LS 3.8.1
DescriptionHi LS,
Attempting to Set template permission for new user, but keep getting a PHP error.

--1st error snip- Attached is full error page in html.
PHP warning
count(): Parameter must be an array or an object that implements Countable
G:\Apache24\htdocs\limesurvey\application\controllers\admin\useraction.php(726)
-----------------==========
714 return false;
715 }
716 }
717
718 private function _refreshtemplates()
719 {
720 $template_a = getTemplateList();
721 foreach ($template_a as $tp => $fullpath) {
722 // check for each folder if there is already an entry in the database
723 // if not create it with current user as creator (user with rights "create user" can assign template rights)
724 $result = Template::model()->findByPk($tp);
725
726 if (count($result) == 0) {
727 $post = new Template;
728 $post->folder = $tp;
729 $post->owner_id = Yii::app()->session['loginID'];
730
731 try {
732 $post->save();
733 } catch (Exception $ex) {
734 Yii::app()->setFlashMessage(
735 sprintf(
736 gT('Could not save theme %s: %s'),
737 $tp,
738 $ex->getMessage()

Steps To Reproduce1-Log in to LS
2-Click on 'Set template permission for this user' icon, to set template perms.
I Get this debug error.
========
Additional InformationI am able to set 'Set global permission for this user' but
Not 'Set template permission for this user'
TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.8.1+180524
I will donate to the project if issue is resolvedNo
BrowserChrome, Edge, IE11
Database & DB-VersionMS SQL Server 2014 SP1(64bit)
Operating System (Server)Windows Server 2012 r2(64bit)
Webserver software & versionApache 2.4.33(64bit)
PHP VersionPHP 7.2.5(64bit)

Activities

John_K

John_K

2018-06-08 01:01

reporter  

PHP warning(Set template permission for this user- Error LS 3.8.1).htm (18,842 bytes)
John_K

John_K

2018-06-21 19:38

reporter   ~48272

Hi LS Bug Team,- Update & Fyi....
I tested this 'Set template permission for this user' feature on LS312, & it works. Am able to Set template permission for a user in LS312.

However, LS390 also generates this same PHP error as LS381 does.
===================
PHP warning
count(): Parameter must be an array or an object that implements Countable
G:\Apache24\htdocs\limesurvey390\application\controllers\admin\useraction.php(726)
714 return false;
715 }
716 }
717
718 private function _refreshtemplates()
719 {
720 $template_a = getTemplateList();
721 foreach ($template_a as $tp => $fullpath) {
722 // check for each folder if there is already an entry in the database
723 // if not create it with current user as creator (user with rights "create user" can assign template rights)
724 $result = Template::model()->findByPk($tp);
725
726 if (count($result) == 0) {
727 $post = new Template;
728 $post->folder = $tp;
729 $post->owner_id = Yii::app()->session['loginID'];
730
731 try {
732 $post->save();
733 } catch (Exception $ex) {
734 Yii::app()->setFlashMessage(
735 sprintf(
736 gT('Could not save theme %s: %s'),
737 $tp,
738 $ex->getMessage()
c_schmitz

c_schmitz

2018-06-26 19:17

administrator   ~48308

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

c_schmitz

2018-06-27 15:29

administrator   ~48327

Version 3.12.3+180627 released

Related Changesets

LimeSurvey: master 40ddc914

2018-06-26 19:17:21

c_schmitz

Details Diff
Fixed issue 13750: PHP warning when setting template permission for a user
mod - application/controllers/admin/useraction.php Diff File

Issue History

Date Modified Username Field Change
2018-06-08 01:01 John_K New Issue
2018-06-08 01:01 John_K File Added: PHP warning(Set template permission for this user- Error LS 3.8.1).htm
2018-06-18 12:53 LouisGac Assigned To => dominikvitt
2018-06-18 12:53 LouisGac Status new => assigned
2018-06-18 12:53 LouisGac Assigned To dominikvitt =>
2018-06-21 19:38 John_K Note Added: 48272
2018-06-26 13:53 LouisGac Assigned To => c_schmitz
2018-06-26 19:17 c_schmitz Changeset attached => LimeSurvey master 40ddc914
2018-06-26 19:17 c_schmitz Note Added: 48308
2018-06-26 19:17 c_schmitz Resolution open => fixed
2018-06-26 19:17 c_schmitz Status assigned => resolved
2018-06-27 15:29 c_schmitz Note Added: 48327
2018-06-27 15:29 c_schmitz Status resolved => closed