Editor 1.6.5 regression - Uncaught TypeError: Cannot read property '28' of undefined

Editor 1.6.5 regression - Uncaught TypeError: Cannot read property '28' of undefined

vipsoftvipsoft Posts: 10Questions: 1Answers: 0

Tracked it down to this change between 1.6.4 and 1.6.5:

182c182
<       return o1 === o2;
---
>       return o1 == o2;

Unfortunately, this is still a problem for me in 1.7.4. (I assume this is the fix for "Loose type checking was only implemented on nested data".)

It's the end of the work day, so I'm posting this here now and will investigate further tomorrow. (It's a complex datatable so it'll take me a while to narrow down the cause.)

Replies

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

    Yes you are correct with which change note that code change belongs to. It was triggered by this thread.

    Are you able to give me some more information about your setup, or even better, a link to a page showing the issue please?

    Thanks,
    Allan

  • vipsoftvipsoft Posts: 10Questions: 1Answers: 0

    Yes, as in the thread, I use the inline editor too. For me, submitting extra fields was an occasional blessing since we log the changes to an audit log and we could see these extra fields.

    I've reduced the example to this:

    https://netcentricity.ca/datatables-investigation/

    Clicking on a checkbox triggers the error.

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

    Thanks. So the issue is that your preSubmit code is expecting the full data set to be submitted, but due to the change, it isn't (since the types are no longer checked).

    Try removing:

                    formOptions: {
                        main: {
                            submit: 'changed'
                        }
                    },
    

    I believe that should resolve the issue, since the default for the main editing mode is to submit all fields.

    Allan

  • vipsoftvipsoft Posts: 10Questions: 1Answers: 0

    I could do that but the intent was to not to see all the fields in our audit log.

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

    I think you'd need to change your preSubmit event handler in that case to allow for fields not being submitted. At the moment it is assuming that they will be, but it sounds like you don't want them always to be submitted.

    Allan

  • vipsoftvipsoft Posts: 10Questions: 1Answers: 0

    Ok, it looks like I can rip out my preSubmit handler entirely. I don't recall why we needed our hack in there. Thanks!

This discussion has been closed.