Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When node form validation fails (e.g. missing title), the attachment tab of newly uploaded file is displayed without the private checkbox. Hence when user validates again the form, the private checkbox is lost making the file public.
Thanks
Laurent
Comments
Comment #1
skcuslapurd CreditAttribution: skcuslapurd commentedHad the same issue. It appears to be because the upload module (function upload_js) caches the node form before the private upload modules form_alter has a chance to put in the private checkbox, so after validation the form is loaded from the cache and displayed without the private upload bits.
The following may be of use to someone. Put it in private_upload_form_alter at the end of the
elseif ($form_id == 'upload_js') {
block.CAVEAT : This isn't tested to any extent other than it appears to work for me and so might work for others.