Customer Portal

Get Involved. Join the Conversation.

Topic

    Raghavendra Karanth
    /ci/ajaxRequest/deleteNotification returns error
    Topic posted April 16, 2019 by Raghavendra Karanth 
    15 Views, 1 Comment
    Title:
    /ci/ajaxRequest/deleteNotification returns error
    Summary:
    /ci/ajaxRequest/deleteNotification returns error
    Content:

    We recently migrated our Customer Portal from ver. 3.2 to 3.7. In one of the buttons to "unsubscribe" from Product/Category KB, we are calling the url /ci/ajaxRequest/deleteNotification but it returns 

    "error":"There was a problem with the request and the action could not be completed."
    

    Payload sent for this POST data are: filter_type, id, rn_contextData, rn_contextToken, rn_timestamp and rn_formToken

    The code was working fine with 3.2. Any idea as to what might be causing this issue? 

    Version:
    3.7

    Comment

     

    • Raghavendra Karanth

      I was able to solve this. The AJAX controller was looking for the "f_tok" payload in the POST request. I added the below lines in my code to get this working.

      $this->data['js']['f_tok'] = \RightNow\Utils\Framework::createTokenWithExpiration(0); --> in the widget getData function of controller.php 

      f_tok: this.data.js.f_tok --> in _onButtonClick function in logic.js file of the widget.

      and for reference, the line of code which changed between the framework version is : if(!$this->checkForValidFormToken())