Welcome, Guest
Username: Password: Remember me

TOPIC: Conditions, etc. stopped working

Conditions, etc. stopped working 3 years 5 days ago #63947

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
On a test PC, I have updated LimeSurvey a few times over the past couple of years without any problems. (I always test the update first before rolling it out to our production server).

Today, however, I experienced a major problem when updating from 1.87, build 8518 to 1.91+, build 10563. The conditionals stopped working, as well as the custom masks I put in certain questions. The field names are exactly the same as before. In fact, I copied the entire production database to the test PC prior to updating LimeSurvey, so that I would be following the same steps when it came to updating the production server.

As far as I can tell, I followed all of the instructions, the same ones I have followed in the past without incident. I did not use the ComfortUpdate. I even deleted one of the conditions and reinserted it and it still would not work. It's as if LimeSurvey does not recognize conditions and masks.

I am sure I have missed a setting or something. Please advise.

tfj
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #63950

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
Probably due to the template changes:
from: docs.limesurvey.org/tiki-index.php?page=...Other_Template_Files :
In versions 1.90 and up question.pstpl replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:
<div {QUESTION_ESSENTIALS} class="{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}">
...and then add the corresponding closing tag to the end of question.pstpl:
</div>
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 3 years 5 days ago by Ben_V.
The administrator has disabled public write access.
The following user(s) said Thank You: tfj

Re: Conditions, etc. stopped working 3 years 5 days ago #63951

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
Thank you, Benitov! So far, so good!

tfj
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #63981

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
Unfortunately, after further testing, I found that although the conditions now work (after the change that Benitov pointed out), the masks still do not work.

For example, I included the following (based upon a reference in the LimeSurvey documentation) to format a US phone number as it is being entered:

function Custom_On_Load(){

$(document).ready(function() {

// Set the 'alt' attributes of the inputs
$('#answer55522X62X419').attr('alt', 'phone-us'); // a pre-defined mask
$('#answer55522X62X421').attr('alt', 'phone-us'); // a pre-defined mask
$('#answer55522X62X420').attr('alt', 'phone-us'); // a pre-defined mask

// Tell the plugin to apply masks to these inputs
$('input:answer55522X62X419').setMask();
$('input:answer55522X62X421').setMask();
$('input:answer55522X62X420').setMask();

});
}

</script>

I figure this has something to do with the new way that the templates are handled. Please advise.

Thanks!

tfj
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #63984

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6239
  • Thank you received: 794
  • Karma: 238
Hello,

Remove the
function Custom_On_Load(){

Only
$(document).ready(function() {
 
// Set the 'alt' attributes of the inputs
$('#answer55522X62X419').attr('alt', 'phone-us'); // a pre-defined mask
$('#answer55522X62X421').attr('alt', 'phone-us'); // a pre-defined mask
$('#answer55522X62X420').attr('alt', 'phone-us'); // a pre-defined mask
 
// Tell the plugin to apply masks to these inputs
$('input:answer55522X62X419').setMask();
$('input:answer55522X62X421').setMask();
$('input:answer55522X62X420').setMask();
 
});


In your script
Last Edit: 3 years 5 days ago by DenisChenu. Reason: code display
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #63986

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
Thank you, Shnoulle, for your suggestion. I tried it and the mask still does not work.

This mask has worked for the past couple of years in earlier versions of LimeSurvey. I suspect that it has something to do with the template update. I am guessing that I am missing something in the template itself (?).

I will appreciate any other suggestions!

tfj
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #64003

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6239
  • Thank you received: 794
  • Karma: 238
Maybe you don't include the meiomask:

docs.limesurvey.org/tiki-index.php?page=...ipt#Text_input_masks
Link to the script by placing <script type="text/javascript" src="{TEMPLATEURL}jquery.meiomask.js" charset="utf-8"></script> within the <head> tag of startpage.pstpl.

Can you put a link to test it directly ?

:)
The administrator has disabled public write access.

Re: Conditions, etc. stopped working 3 years 5 days ago #64007

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
Yes, that has been within the head tag all along. That is why it has worked properly over the last couple of years, (until this update).

I am wondering now if it has something to do with the {TEMPLATEURL} since the custom template was moved to the upload directory, (instead of the original template directory), when I updated LimeSurvey to 1.91+. If this is correct, then would someone tell me how to change this? As an experiment, I tried moving the custom templates to the original template directory, but that did not solve the problem. In fact, things got worse.

As for linking to the survey, I put it on a test PC (before I install the update to the production server). This test PC is not accessible to the outside world. I use it just for this purpose -- to develop and test before going live.

Any advice will be greatly appreciated. I would like to be able to use the newest version of LimeSurvey on our production server. In our environment, I usually have only one chance a year to make the update.

tfj
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.227 seconds
Donation Image