- Issue created by @kingdutch
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 8:54am 31 August 2023 - 🇳🇱Netherlands kingdutch
This probably needs a test but unfortunately I don't currently have the time, nor am I entirely sure what kind of Kernel test would best test this (without actually creating a module that implements the reproduction steps).
- Status changed to Needs review
over 1 year ago 12:16pm 31 August 2023 - last update
over 1 year ago 30,121 pass, 2 fail - 🇳🇱Netherlands kingdutch
Our own tests showed that
#access
isn't always defined. Moving to Needs review to trigger test bot, although tests are still needed. The last submitted patch, 3: drupal-3384497-3.patch, failed testing. View results →
- Status changed to Needs work
over 1 year ago 7:51am 4 September 2023 - 🇳🇱Netherlands kingdutch
The test failure actually suggests that tests for this already exist :D
In #2715859: ImageWidget::validateRequiredFields() produces an error message if an image field is hidden with hook_entity_field_access() → test coverage was specifically added to make sure ManagedFile fails validation even when it's hidden. However the issue doesn't quite address whether this is just to entrench the status quo into a test or whether this was a conscious decision on how ManagedFile should work (seeing as it's different from other fields in Drupal).
#3011744: File/image widget validation is inconsistent based on cardinality/visibility → was created as follow-up which suggests ManagedFile has a different code-path from the rest of Drupal when it comes to validation, to provide a better error message. That would explain the discrepancy. However it's unclear to me of whether this is a duplicate of #3011744: File/image widget validation is inconsistent based on cardinality/visibility → or whether this is a separate issue.