soft delete yielding system error when I update the bit field
soft delete yielding system error when I update the bit field

I am utilizing the inline example (with a trash can icon on each row) and adding logic to perform a soft delete on click. When I click on delete, I get a: A system error has occurred (More information).
maintable.on('click', 'tbody td.row-remove', function (e) {
maineditor
.edit( maintable.rows( {selected: true } ).indexes(), false )
var row = maintable.rows({ selected: true }).indexes();
//.val( 'ColoredGoals.Inactive', 0 )
//.submit();
maineditor
.hide(maineditor.fields())
.one('close', function () {
setTimeout(function () {
// Wait for animation
maineditor.show(maineditor.fields());
}, 500);
})
.edit(row, {
title: 'Delete',
message:
row.length === 1
? 'Are you sure you wish to delete this row?'
: 'Are you sure you wish to delete these ' +
row.length +
' rows',
buttons: 'Delete'
})
.val('ColoredGoals.Inactive',1);
});
I see 3 warnings in my server logs:
2025-09-05 20:28:02 PHP Warning: foreach() argument must be of type array|object, null given in C:\ClientSites\da-pool.com\jyorkejudge4.org\php\lib\Editor.php on line 1050 php_error
2025-09-05 20:28:02 PHP Warning: foreach() argument must be of type array|object, null given in C:\ClientSites\da-pool.com\jyorkejudge4.org\php\lib\Editor.php on line 845 php_error
2025-09-05 20:28:02 PHP Warning: foreach() argument must be of type array|object, null given in C:\ClientSites\da-pool.com\jyorkejudge4.org\php\lib\Editor.php on line 1074 php_error
ColoredGoals.Inactive is defined in the editor set to hidden, it's also defined in the datatable with the column set to visible. It's a MS Sql Bit value.
When the field is not hidden, I can edit it and set to a 1;
Answers
Line 1050 of Editor.php isn't a
foreach
statement. What version of the Editor PHP libraries are you using? I'd suggest updating to the latest version. It might or might not solve the issue, but it is a good starting point!Allan
Gah - I was looking at the unreleased version, sorry! It is a
foreach
in the latest release version.An error there suggests the data hasn't been submitted. Can you show me the PHP controller you are using? Are you passing in
$_POST
to the->process()
method?Allan
Post, is this what you wanted to see?
ajax: {
url: './php/coloredgoals' + sfilename + '.php',
type: 'POST',
data: {
pageaid: pPageAID,
useraid: pUserAID,
}
},
That's certainly useful, thank you. But could you show me the file PHP file as well? A link to the page would be really useful too, so I can see what is going on at the client-side.
Allan
Thank you,
here is a link (you can click on any of the trash icons to delete)
https://jyorkejudge.org/coloredgoals_test2.php
I believe it has to do with the selector. It seems to work if I select the row prior to clicking on the trash can icon for the row. Do I need to add code so when the trash icon is clicked it selects the current row before proceeding?
here is the server side php:
Many thanks. I don't immediately see what is going wrong from the code, so I thought I'd take a look at the page, but on load I get:
Allan
It may have been when I was making some updates. I just checked, and the page is working. The issue appears to be related to clicking the delete icon for a row without first selecting the row.