View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18191Bug reportsExpression Managerpublic2023-04-24 16:33
Reportertammo Assigned ToDenisChenu  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version5.3.x 
Fixed in Version6.0.x 
Summary18191: Cannot use statCount in group condition
Description

Using core plugin: statFunctions

While you can use statCount("id") > 6 as question condition, you cannot use this as the condition for a group.

This results (when trying to save the just edited group) to an error 500: Call to a member function getIsActive() on null

This

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)5.3.19
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL
Server OS (if known)Centos
Webserver software & version (if known)Apache
PHP Version7.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-06-14 17:38

developer   ~70351

An lss please ?

tammo

tammo

2022-06-14 17:46

developer   ~70352

tammo

tammo

2022-06-14 17:47

developer   ~70353

I cannot demonstrate adding statCount>6 to the group condition, since this ends in an error 500.

DenisChenu

DenisChenu

2022-06-14 17:51

developer   ~70354

Yes, but have a lss : less work for me ;)

DenisChenu

DenisChenu

2022-06-14 17:55

developer   ~70355

Can not reproduce …

  1. Import included survey
  2. Goes to second group
  3. Edit , put statCount("id") > 6 in condition
  4. Save …

Can you activate debug mode ?

I can create a fix here : https://github.com/LimeSurvey/LimeSurvey/blob/420083bf67ffae54b80505896962baa1751bf851/application/core/plugins/statFunctions/countFunctions.php#L29
But i like to know how to reproduce the issue :)

DenisChenu

DenisChenu

2022-06-14 18:01

developer   ~70356

PS : and check if validate survey logic file fix the issue ( set the sid in LimeExpressionManager)

DenisChenu

DenisChenu

2022-06-14 18:57

developer   ~70360

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

DenisChenu

DenisChenu

2022-06-17 11:51

developer   ~70402

@tammo :

Can not reproduce …

Import included survey
Goes to second group
Edit , put statCount("id") > 6 in condition
Save …

Can you activate debug mode ?

DenisChenu

DenisChenu

2022-09-30 16:50

developer   ~72034

@tammo : can you test ?

But again : with only this plugin : i can not reproduce.

DenisChenu

DenisChenu

2023-04-18 17:34

developer   ~74530

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

DenisChenu

DenisChenu

2023-04-18 17:34

developer   ~74531

ping @tammo :)

tibor.pacalat

tibor.pacalat

2023-04-18 18:28

administrator   ~74533

I just managed to test this on Limesurvey 6.1.0-dev and fresh install of that plugin. Didn't encounter any errors.

DenisChenu

DenisChenu

2023-04-19 10:59

developer   ~74538

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

LimeBot

LimeBot

2023-04-24 16:33

administrator   ~74612

Fixed in Release 6.0.3+230424

Related Changesets

LimeSurvey: master 7c2db401

2023-04-19 10:59:19

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18191: Cannot use statCount in specific condition (#3056)

* Fixed issue 18191: Cannot use statCount in specific condition
Dev: add a surveyid checker : is set + survey exist + survey is active

* Dev: fix oups …

* Dev: add a getCurrentSurveyid in API

* Dev: oups on return value
Affected Issues
18191
mod - application/core/plugins/statFunctions/config.xml Diff File
mod - application/core/plugins/statFunctions/countFunctions.php Diff File
mod - application/libraries/PluginManager/LimesurveyApi.php Diff File

Issue History

Date Modified Username Field Change
2022-06-14 17:10 tammo New Issue
2022-06-14 17:10 tammo Assigned To => DenisChenu
2022-06-14 17:10 tammo Status new => assigned
2022-06-14 17:38 DenisChenu Note Added: 70351
2022-06-14 17:38 DenisChenu Bug heat 0 => 2
2022-06-14 17:46 tammo Note Added: 70352
2022-06-14 17:46 tammo File Added: survey_archive_statCountFunctionsTest.lsa
2022-06-14 17:46 tammo Bug heat 2 => 4
2022-06-14 17:47 tammo Note Added: 70353
2022-06-14 17:51 DenisChenu Note Added: 70354
2022-06-14 17:55 DenisChenu Note Added: 70355
2022-06-14 17:55 DenisChenu File Added: Capture d’écran du 2022-06-14 17-53-08.png
2022-06-14 18:01 DenisChenu Note Added: 70356
2022-06-14 18:01 DenisChenu Status assigned => feedback
2022-06-14 18:57 DenisChenu Note Added: 70360
2022-06-17 11:51 DenisChenu Note Added: 70402
2022-06-17 11:52 DenisChenu Assigned To DenisChenu => tammo
2022-09-30 16:50 DenisChenu Note Added: 72034
2022-09-30 16:50 DenisChenu Status feedback => ready for testing
2023-04-18 17:34 DenisChenu Note Added: 74530
2023-04-18 17:34 DenisChenu Note Added: 74531
2023-04-18 18:28 tibor.pacalat Note Added: 74533
2023-04-18 18:28 tibor.pacalat Bug heat 4 => 6
2023-04-18 19:44 DenisChenu Assigned To tammo => ollehar
2023-04-18 19:44 DenisChenu Status ready for testing => ready for merge
2023-04-19 10:59 DenisChenu Changeset attached => LimeSurvey master 7c2db401
2023-04-19 10:59 DenisChenu Note Added: 74538
2023-04-19 10:59 DenisChenu Assigned To ollehar => DenisChenu
2023-04-19 10:59 DenisChenu Resolution open => fixed
2023-04-20 09:27 DenisChenu Status ready for merge => resolved
2023-04-20 09:27 DenisChenu Fixed in Version => 6.0.x
2023-04-24 16:33 LimeBot Note Added: 74612
2023-04-24 16:33 LimeBot Status resolved => closed
2023-04-24 16:33 LimeBot Bug heat 6 => 8