Skip to content

Commit

Permalink
Fixed issue: Ajax-Mode totally unfunctional
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jun 5, 2018
1 parent 0ec0b3b commit 0f710b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/helpers/expressions/em_manager_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8857,7 +8857,7 @@ public static function ProcessCurrentResponses()
{
$json = $value;
$aFiles = json_decode($json);
$iSize=count($aFiles);
$iSize=@count($aFiles);
// if the files have not been saved already,
// move the files from tmp to the files folder

Expand Down
25 changes: 18 additions & 7 deletions themes/survey/vanilla/scripts/ajaxify.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
*/

//Check if we have to work on IE10 *sigh*
var isIE10 = false;
/*@cc_on
if (/^10/.test(@_jscript_version)) {
isIE10 = true;
}
@*/
console.ls.log("isIE10: ",isIE10);

// Submit the form with Ajax
var AjaxSubmitObject = function () {
var activeSubmit = false;
Expand Down Expand Up @@ -74,20 +83,22 @@ var AjaxSubmitObject = function () {

var bindActions = function () {
var globalPjax = new Pjax({
elements: '#limesurvey', // default is "a[href], form[action]"
elements: ['form#limesurvey'], // default is "a[href], form[action]"
selectors: ['#dynamicReloadContainer', '#beginScripts', '#bottomScripts'],
debug: window.debugState.frontend,
debug: true,
forceRedirectOnFail: true,
reRenderCSS : true,
logObject : console.ls ? (window.debugState.frontend ? console.ls : console.ls.silent) : console,
scriptloadtimeout: 1500
logObject : new ConsoleShim('PJAX-LOG'),
scriptloadtimeout: 1500,
});
// Always bind to document to not need to bind again
$(document).on('click', '.ls-move-btn',function (e) {
e.preventDefault();
$('#limesurvey').append('<input name=\''+$(this).attr('name')+'\' value=\''+$(this).attr('value')+'\' type=\'hidden\' />');
$('#limesurvey').trigger('submit');
return false;
if(isIE10) {
e.preventDefault();
$('#limesurvey').trigger('submit');
return false;
}
});

// If the user try to submit the form
Expand Down

5 comments on commit 0f710b3

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Arg … not IE10

@3ruce
Copy link

@3ruce 3ruce commented on 0f710b3 Jun 15, 2018

Choose a reason for hiding this comment

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

ok, this commit broke my survey in the major browsers.... I've tested commits and releases after this and the problem remains... I've also tested the previous commit 0ec0b3 and the I don't have the problem...

In brief, I have a lot of mandatory questions but they are only shown if a relevance equation condition is met... prior to this commit, these questions weren't shown and the mandatory message wasn't triggered... however, from this commit and forward, respondents get these mandatory messages that correspond to questions that they haven't, by design, seen and therefore they can't respond to them.

Hopefully this makes sense? Please let me know if you'd like me to file a bug report or similar...

Thanks...

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hopefully this makes sense? Please let me know if you'd like me to file a bug report or similar...

Please, please, please : fill a bug report : https://www.limesurvey.org/community/bug-tracker

Did it work if you deactivate ajax mode on survey level ?

@3ruce
Copy link

@3ruce 3ruce commented on 0f710b3 Jun 15, 2018

Choose a reason for hiding this comment

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

Let me test deactivating ajax mode and see what happens

@3ruce
Copy link

@3ruce 3ruce commented on 0f710b3 Jun 15, 2018

Choose a reason for hiding this comment

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

Ok, turning off ajax mode in the settings for bootswatch works... Everything is also working when running 3.10.0+180611... I'll file a bug report... thanks...

Please sign in to comment.