This topic is locked
[SOLVED]

 Button Issue

6/9/2019 12:37:56 PM
PHPRunner General questions
bobdutil author

I have a button on a list page that when clicked calls a stored procedure and then opens a custom pdf report. The button works perfectly on the test site. However, after moving everything over to the production site the button no longer works and I get this error in the web developers tools. "Uncaught SyntaxError: Unexpected token < in JSON at position 3 at JSON.parse(<anonymous>) at Object.success(RunnerAll.js:367)"... etc
RunnerAll.js:367 highlighted in bold.



if(!isManyKeys&&rowData.keys.length){keyObject=rowData.keys;location='grid';}

**reqParams={params:JSON.stringify(params),keys:JSON.stringify(keyObject),isManyKeys:isManyKeys,location:location||""};$.post(Runner.getPageUrl("buttonhandler"),reqParams,function(result){pageObj.buttonEventAfter[ctrl.btnName](JSON.parse(result),ctrl,pageObj,proxy,pageid,rowData,row);ctrl.setEnabled();});e.preventDefault();e.stopPropagation();}});Runner.AjaxRow=function(inlineRow){this.row=inlineRow;if(!inlineRow){this.row={id:1,gridLayout:""};}}**

Runner.AjaxRow.prototype={fieldCell:function(fName){var $span=Runner.getFieldSpan(fName,this.row.id);if(this.row.gridLayout===Runner.pages.constants.VERTICAL_LAYOUT){return $span.closest("div");}


Any ideas on where I should look?
Thanks,

Bob

jadachDevClub member 6/9/2019

If it works locally and not in production, the first place I check is permissions.

C
CTom 6/10/2019

Hi,
You could also check if there are mod_security rules active on the production server.
Catalin

admin 6/10/2019

The correct place to start is this article in the manual:

https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm
It will show you the exact error message behind the scene.

bobdutil author 6/10/2019

Thanks for the replies, everyone. I did manage to track down the problem. One of the stored procedures needed to be adjusted.