View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
08915Bug reportsPluginspublic2020-03-13 18:46
ReporterResearchOnBlogs Assigned Toollehar  
PrioritynormalSeverityminor 
Status closedResolutionopen 
Product Version2.05+ 
Summary08915: Textfield for Plugin Settings has not default value
Description

Textfield for Plugin Settings has not default value. The select field one.. Attached a patch.

TagsNo tags attached.
Attached Files
LS_SettingsWidget_defaultvalue_Text.patch (863 bytes)   
Index: application/extensions/SettingsWidget/SettingsWidget.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- application/extensions/SettingsWidget/SettingsWidget.php	(date 1395741640000)
+++ application/extensions/SettingsWidget/SettingsWidget.php	(revision )
@@ -366,7 +366,7 @@
         {
             $out = '';
             $id = $name;
-            $value = isset($metaData['current']) ? $metaData['current'] : '';
+            $value = isset($metaData['current']) ? $metaData['current'] : (isset($metaData['default']) ? $metaData['default'] : null); // default value
             $readOnly = isset($metaData['readOnly']) ? $metaData['readOnly'] : false;
             if (isset($metaData['label']))
             {
\ No newline at end of file
Bug heat10
Complete LimeSurvey version number (& build)140320
I will donate to the project if issue is resolvedNo
Browser
Database type & versionxx
Server OS (if known)xxxx
Webserver software & version (if known)xx
PHP Versionxx

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2014-03-28 19:28

developer   ~29592

Are you sure ?

I use
'authwpdbprefix' => array(
'type' => 'string',
'label' => 'WordPress DB prefix',
'default' => 'wp
'
),

with success

ResearchOnBlogs

ResearchOnBlogs

2014-03-28 20:07

developer   ~29594

Last edited: 2014-03-28 20:17

Mhm..

'my_subject' => array(
'type' => 'string',
'default' => $subject, /// this wasn't accepted without the patch
'class' => 'myclass',
'tab' => 'notification',
// @todo: Setting no used yet
'category' => 'mycat',
// @todo: Setting no used yet
'label' => 'Subject for notification',
'current' => $this->get('my_subject', 'Survey', $event->get('survey'))
),

I think the input of the patch is missing. Take a look on the part of the select-type. There you find the same, to handle current and default value.

DenisChenu

DenisChenu

2014-03-29 10:45

developer   ~29598

Yes, i look at it, but don't look before use 'defautlt'=>'wp_' ???

See strange it's work, but maybe set elsewwhere.

Sam : its' needed ?

sammousa

sammousa

2014-04-08 14:19

reporter   ~29692

Current sets the current value, this is not the same as the default value.

The base plugins fills the current value when getPluginSettings is called. This is different from default.

Also this allows you to use the defaults like this:
$this->get('setting1', null, null, $this->settings['setting1']['default'])

ResearchOnBlogs

ResearchOnBlogs

2014-04-14 15:57

developer   ~29745

what about my patch? do you agree with it? I did simply the same as in line 334:

public function renderSelect($name, array $metaData, $form = null)

of the settingsWidget.PHP

ollehar

ollehar

2016-08-25 12:28

administrator   ~40492

Two year old issue for 2.05 (not 2.50). Still relevant?

ollehar

ollehar

2016-10-26 12:24

administrator   ~41553

Please give feedback.

DenisChenu

DenisChenu

2016-10-26 12:37

developer   ~41554

@olle : think it's more a different usage ....

In fact : It's OK for "global plugi settinsg" : default value is set when call plugin manager
But not used in Survey settings.

Actually : i don't care :). I always enforce default value if needed (because it must be set to default when get settings)

c_schmitz

c_schmitz

2020-03-13 18:46

administrator   ~56474

This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, please reopen this bug report. Thank you.

Issue History

Date Modified Username Field Change
2014-03-28 13:36 ResearchOnBlogs New Issue
2014-03-28 13:36 ResearchOnBlogs File Added: LS_SettingsWidget_defaultvalue_Text.patch
2014-03-28 19:28 DenisChenu Note Added: 29592
2014-03-28 20:07 ResearchOnBlogs Note Added: 29594
2014-03-28 20:17 ResearchOnBlogs Note Edited: 29594
2014-03-29 10:45 DenisChenu Note Added: 29598
2014-03-29 10:45 DenisChenu Assigned To => sammousa
2014-03-29 10:45 DenisChenu Status new => assigned
2014-04-08 14:19 sammousa Note Added: 29692
2014-04-14 15:57 ResearchOnBlogs Note Added: 29745
2016-01-20 10:59 sammousa Assigned To sammousa =>
2016-01-21 09:11 DenisChenu Status assigned => new
2016-08-25 12:25 c_schmitz Assigned To => ollehar
2016-08-25 12:25 c_schmitz Status new => assigned
2016-08-25 12:28 ollehar Note Added: 40492
2016-10-26 12:24 ollehar Status assigned => feedback
2016-10-26 12:24 ollehar Note Added: 41553
2016-10-26 12:37 DenisChenu Note Added: 41554
2020-03-13 18:46 c_schmitz Note Added: 56474
2020-03-13 18:46 c_schmitz Status feedback => closed