Maximum multi row edit?

Maximum multi row edit?

YOMYOM Posts: 53Questions: 22Answers: 1

If I select any number of rows and multi edit a column
only the first 12 rows actually get updated with the edit.

Is there a hard coded limit or am I doing something wrong?

Thanks

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    There is no hard coded limit. When you submit the edit, do you get any error messages? Can you link to the page should the issue so I can debug it (although I'm afraid it will be Tuesday before I can as I'm travelling atm, and phone screens don't lend themselves to debugging!).

    Also it would be worth looking in the browsers network tools to make sure the full data set is being submitted.

    Regards,
    Allan

  • YOMYOM Posts: 53Questions: 22Answers: 1
    edited June 2016

    Sorry for the delay. No I did not see any error messages. I looked at the JSON post/response data and it only returns 12 rows while it POSTs all of the rows so I suspect it has something to do with server side processing. Here is a link to the page you can debug it on: [retracted]

    Let me know if you would like to see the javascript used to create this page or the server side processing script.

    Thanks

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    The link requires a login.

    something to do with server side processing

    Server-side processing means that only the rows currently displayed will be sent by the server.

    Allan

  • YOMYOM Posts: 53Questions: 22Answers: 1

    I removed the login. You should be able to access it now.

    Sorry I'm obviously not 100% on the terminology for datatables. Regardless, the edit request is responding with less rows than it is POSTing.

    Thanks

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Thanks for the link - I can indeed see the issue. However I'm afraid I'm not immediately sure what is causing it!

    Could you show me your server-side code (i.e. table.mains3.php)?

    Also, could you try adding:

    formOptions: {
      main: {
        submit: 'allIfChanged'
      }
    }
    

    to your Editor initialisation. That will cause it to submit only the changed data. I'm wondering if the server is truncating the input data (although that would be an odd thing to do - its only 90K that is being sent).

    Allan

  • YOMYOM Posts: 53Questions: 22Answers: 1
    edited June 2016

    I tried adding that option to my initialization. Unfortunately, it did not seem to resolve the issue. Here is the server side code:
    http://pastebin.com/U8fzBJVq

    Also, would you mind deleting the link to the page I posted once you are done? I cannot edit that post anymore.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Thanks for the reply.

    The formOptions object should actually go in the Editor initialisation rather than DataTables (its currently in the DataTables init, but commented out). Could you move it there and see if that helps?

    I've just tried setting 50 rows in a single edit in this example (you need to run $('#example').DataTable().page.len(50).draw() on the console to show 50 rows since that example doesn't have a page length control), and it appears to work without any problem. I'm also not aware of any options to limit the number of queries that PDO can run.

    If you take a look in your server's error logs (and MySQL logs, if you have MySQL logging enabled), does do they show anything?

    Regards,
    Allan

  • YOMYOM Posts: 53Questions: 22Answers: 1
    edited June 2016

    I tried moving it there and unfortunately it still didn't work. I did find something interesting that was dumped in the apache log the last time I tried to edit more than 12 rows.

    [Thu Jun 16 12:20:39.591528 2016] [:error] [pid 17525] [client 69.204.66.36:51346] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://{retracted}/pricetool.html

    After reading up on this error it appears that it truncates an extra data past the limit which matches my situation perfectly. I upped the max_input_vars to 10000 and it appears to work perfectly.

    Thanks

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    What would do it! Fantastic. Thanks for letting me know about this and great to hear you've got it working now!

    Regards,
    Allan

  • YOMYOM Posts: 53Questions: 22Answers: 1

    I messed up and forgot to remove the IP from my last post... Would you mind removing it one more time?

    Thanks

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Sure - its done now.

  • 100a1100a1 Posts: 3Questions: 0Answers: 0

    Rather than increase the number of max_input_vars in the php.ini, beyond the default 1000, is it possible for the client javascript to send a single json with all the editor form field parameters? Rather than one for each row being edited. Then the receiving php script could decode this json.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    is it possible for the client javascript to send a single json with all the editor form field parameters?

    Yes. The last example in the ajax.data page shows how that can be done.

    If you are using the PHP libraries you could then json_decode that into an array and pass that into the process() method rather than $_POST.

    Nice idea - thanks for posting that!

    Allan

This discussion has been closed.