Ajax error 7 - revisited

Ajax error 7 - revisited

bonaventurebonaventure Posts: 15Questions: 7Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:

Description of problem:

datatables adds parameters to AJAX URL
http://localhost:8081/DEMO/lessoninstances/47?_=1703245475489
should be
http://localhost:8081/DEMO/lessoninstances/47

thus returning rtc 400 from server (bad request)

This only happens with french locale and only with certain data.
Parameter ?_=1703245475489 changes with each call.

Cannot use locale FR until sulution.

kind regards

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    The _ parameter is the jQuery anti-cache parameter. Se the cache option for ajax to true - i.e.:

    ajax: {
      url: '/DEMO/lessoninstances/47',
      cache: true
    }
    

    Allan

  • bonaventurebonaventure Posts: 15Questions: 7Answers: 0

    ok, thanks, I added cache:true, so the ?1_xxxx is gone, but not the 400

    This raised the question why this is happening only sometimes, and only with locale FR.

    I found out that it happens independently from datatables, so I also get a 400 when I put the URL in the browser manually.

    weird

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Perhaps something to do with the headers? Check the difference between the headers of a successful request and a failed request. Then use cURL to recreate the request on the command line so you can reproduce and debug the server-side script.

    Allan

  • bonaventurebonaventure Posts: 15Questions: 7Answers: 0

    found it.
    message_fr.properties contains:

    lis.scheduleText={0} { 1}, {2}- {3}

    resource replacement parameter with a leading blank.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Cool. Good to hear you've got it sorted.

    Allan

Sign In or Register to comment.