Hi,ran into a strange issue… on windows this function works, but on linux it causes the import routing to die after the 1st record is displayed. When we create a new user, we need to run another function in record_inserted() to create an associated record else where. This works perfectly fine when use “insert” from the form, but also gets fired when the import happens, but for some reason as noted, causes the import to mis-behave.we’ve tried different calls , created separate db connects, but when it hits this certain line (see ===>>) it stops execution of the import.Called from record_inserted()
function _createCampaignStatusRecord($row) {
$conn1 = Conn();
$recipient_groups = @explode(",", $row['Campaign_Groups']);
foreach($recipient_groups as $key => $value) {
$employee_key = $row['id'];
$campaign_status = 351; // default
$DateCreated = $row['DateCreated'];
$CreatedBy = $row['CreatedBy'];
$UserId = $CreatedBy;
$sSql = "SELECT tenantId FROM tbl_sys_membership m WHERE m.UserId=". $UserId;
$tenantId = @ExecuteScalar($sSql, $conn1);
if($tenantId == false)
$tenantId = 0;
if($UserId == -1)
$sSql2 = "SELECT id, tenantid, campaign_name FROM dams.dams_campaigns c WHERE find_in_set($value, c.campaign_recipients)";
else
$sSql2 = "SELECT id, tenantid, campaign_name FROM dams.dams_campaigns c WHERE find_in_set($value, c.campaign_recipients) AND tenantId=$tenantId";
$res = Conn()->executeQuery($sSql2);
while(($row1 = $res->fetchAssociative()) !== false) {
$campaign_id = $row1['id'];
$sSql3 = "INSERT INTO dams_employee_status (`employee_id`,`campaign_id`,`campaign_status`,`UserId`, `DateCreated`,`CreatedBy` ) VALUES ('$employee_key', '$campaign_id', '$campaign_status','$UserId','$DateCreated', '$CreatedBy')";
===>> Conn()->executeQuery($sSql3);
}
}
}
there are a few sql calls in this function. the line where it gags: Conn()->executeQuery($sSql3);, we’ve tried execute(), the Conn->, $conn1, many other variables… remarking this out, and the import works correctly. no errors to note in the debugger, just a single record displayed on the import dialog with an “x” next to the single record, and displays the save and close button. in various scenarios, at times it will do the import but skip the “save” and insert the records directly into the table.not sure if we’re corrupting global connections causing this, but can’t understand why it works on windows and not our linux box.enabled sql logging but appears no log file is being created in /logphpM: v2024.16
Linux: tumblweed - rolling updates
mariadb from 11.4.2-MariaDB, client 15.2 for Linux (x86_64) using EditLine wrapperwindows 11 Pro, v24H2
wamp v3.3.0 (not using the embedded mysql )
mySQL: v 9.0.0