You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
send_rx_pdf_is_updated is getting set to zero when no fields on the Prescription form are being modified. Reviewing hook_save_record in ExternalModule.php, it appears that there are no qualifiers around this code block:
// New PDF needs to be generated as changes are made to form after PDF is created.
// Reset pdf_is_updated flag to generate new PDF.
$field_name = 'send_rx_pdf_is_updated';
send_rx_save_record_field($project_id, $event_id, $record, $field_name, '0');
// New PDF needs to be generated as changes are made to form after PDF is created.
to see that code in context.
My suspicion is that this code is firing when other forms are updating data. This resets the send_rx_pdf_is_updated to zero. Subsequent access to the Review and Send RX form will cause a PDF regeneration even though no data was updated on the Prescription form. If this is right, the above code block would need to be wrapped in a test to verify that the current instrument is the instrument holds a field we know is on the Prescription form. send_rx_prescriber_email would be a good candidate.
This code might work in place of the above at line 759:
// Checking if we are on Prescription form step.
if ($Proj->metadata['send_rx_prescriber_email']['form_name'] == $instrument) {
// New PDF needs to be generated as changes are made to form after PDF is created.
// Reset pdf_is_updated flag to generate new PDF.
$field_name = 'send_rx_pdf_is_updated';
send_rx_save_record_field($project_id, $event_id, $record, $field_name, '0');
}
The text was updated successfully, but these errors were encountered:
send_rx_pdf_is_updated
is getting set to zero when no fields on the Prescription form are being modified. Reviewinghook_save_record
inExternalModule.php
, it appears that there are no qualifiers around this code block:See
send_rx/ExternalModule.php
Line 759 in 8fdaf2a
My suspicion is that this code is firing when other forms are updating data. This resets the send_rx_pdf_is_updated to zero. Subsequent access to the Review and Send RX form will cause a PDF regeneration even though no data was updated on the Prescription form. If this is right, the above code block would need to be wrapped in a test to verify that the current instrument is the instrument holds a field we know is on the Prescription form.
send_rx_prescriber_email
would be a good candidate.This code might work in place of the above at line 759:
The text was updated successfully, but these errors were encountered: