Hi,
I ran into an issue with grid insert / multi-row insert when using Row_Inserting() to skip duplicate rows by returning null.
I found that the generated list page code already supports this pattern, because in gridInsert() it checks:
if ($gridInsert === null) { // Record skipped
...
}
However, the generated addRow() method was still declared with a strict bool return type, which caused PHP to throw a fatal error when Row_Inserting() returned null.
The error was essentially:
Return value must be of type bool, null returned
To make it work, I had to change this file:
%AppData%\phpmaker2025\node_modules\@phpmaker\php2025\shared\shared-functions.php
from:
protected function addRow(?array $oldRow = null): bool
to:
protected function addRow(?array $oldRow = null): ?bool
Reason:
Row_Inserting() in my project intentionally returns null for skipped rows during grid insert, and the generated gridInsert() logic already expects that case. So the return type of addRow() seems inconsistent with the rest of the generated code.
My question is:
if I patch this template file, will it be overwritten every time PHPMaker updates its templates, or is this considered a stable/customizable location that will remain unchanged across updates?
Thanks.