Skip to content

Commit

Permalink
Fixed issue #13206: Unable to update Advanced question setting after …
Browse files Browse the repository at this point in the history
…activation
  • Loading branch information
lacrioque committed Feb 2, 2018
1 parent 54ac459 commit b132eac
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -36,7 +36,7 @@
<div class="form-group">
<!-- Form Group -->
<!-- Label -->
<label class=" control-label" for='<?php echo $aAttribute['name'];?>' title='<?php echo $aAttribute['help'];?>'>
<label class="col-sm-12 control-label" for='<?php echo $aAttribute['name'];?>' title='<?php echo $aAttribute['help'];?>'>
<?php
echo $aAttribute['caption'];
if ($aAttribute['i18n']==true) { ?> (<?php echo $aAttribute['language'] ?>)<?php }
Expand All @@ -46,10 +46,10 @@
<!-- Input -->
<div class="">
<?php
if ( $aAttribute['readonly'] || (isset($aAttribute['readonly_when_active']) && $bIsActive) )
if (( $aAttribute['readonly'] || (isset($aAttribute['readonly_when_active']) && $aAttribute['readonly_when_active'] == 'Y')) && $bIsActive )
{
// Alternate solution (maybe better for 3.0) : add the readonly/disable attribute (for singleselect or switch or buttongroup : this is really needed)
echo "<div class='form-control-static'>".\CHtml::encode($aAttribute['value'])."</div>";
echo "<input type='text' class='form-control' disabled value='".\CHtml::encode($aAttribute['value'])."' />";
}
else
{
Expand Down

2 comments on commit b132eac

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

( $aAttribute['readonly'] || ((isset($aAttribute['readonly_when_active']) && $aAttribute['readonly_when_active'] == 'Y') && $bIsActive ) )

  • readonly : always readonly
  • readonly_when_active : readonly wand active

We can easily add a readonly_when_active to false to default

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need isset : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/questionHelper.php#L1624

Then ( $aAttribute['readonly'] || ($aAttribute['readonly_when_active'] && $bIsActive ) )

Please sign in to comment.