I've tested
patch 3385335-03.patch
on Drupal 10.1.6, and it's working
perfectly
fine for me. The issue regarding Ludwig integration seems to be resolved with this patch. Kudos to the contributors for their efforts in addressing this issue.
Best regards,
malikarslanasif131
I successfully applied the webform_rest-add_file_upload_resource-2899902-61.patch #61 on Drupal Version 9.5.10 and PHP Version 8.1.26, and it worked fine. Thank you for the patch!
However, when testing on Drupal Version 10.1.6, I encountered an error related to Bytes:toInt. The issue seems to be resolved with the update in patch #69.
protected function getElementValidators(array $element) {
$validators = [
// Add in our check of the file name length.
'file_validate_name_length' => [],
];
// Cap the upload size according to the PHP limit.
if (version_compare(\Drupal::VERSION, '9.1', '<')) {
$max_filesize = Bytes::toInt(Environment::getUploadMaxSize());
}
else {
$max_filesize = Bytes::toNumber(Environment::getUploadMaxSize());
}
if (version_compare(\Drupal::VERSION, '9.1', '<')) {
if (!empty($element["#max_filesize"])) {
$max_filesize = min(
$max_filesize,
Bytes::toInt($element['#max_filesize'] * 1024 * 1024)
);
}
}
else {
if (!empty($element["#max_filesize"])) {
$max_filesize = min(
$max_filesize,
Bytes::toNumber($element['#max_filesize'] * 1024 * 1024)
);
}
}
// There is always a file size limit due to the PHP server limit.
$validators['file_validate_size'] = [$max_filesize];
// Add the extension check if necessary.
if (!empty($element['#file_extensions'])) {
$validators['file_validate_extensions'] = [$element['#file_extensions']];
}
return $validators;
}
Thank you for the continued efforts in maintaining and improving this patch.
Best regards,
malikarslanasif131