Notice: Undefined offset: 0 in /Field/FieldWidget/FileWidget.php on line 195

Created on 15 June 2020, over 4 years ago
Updated 2 March 2023, over 1 year ago

Problem/Motivation

I'm getting this image when attempting to add a conditional field - the target field being a name field from the name module and the controlled by field being a list field.

Undefined offset: 0 in /app/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php on line 195

Steps to reproduce

TBA

Proposed resolution

TBA

Remaining tasks

Provide complete steps to reproduce the issue β†’ (starting from "Install Drupal core").
Add tests
Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: works as designed

Version

9.5

Component
File systemΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    In #8 where a committer explained how this should no happen in core and to progress this steps to reproduce are needed. They are to be added to the issue summary.

    Since we need more information to move forward with this issue, I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Hi,

    It is very odd. We have tested the patch and asked you to push it to production because it resolves our reported issues and you decided to close it and postpone instead??

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @coaston, In order for a change to made we need to know how to reproduce the problem on Drupal core so that a test can be written. A core maintainer asked for that 3 years ago and it has not been supplied. If you can do that, it would be very helpful. Add the steps to the Issue Summary, in the 'steps to reproduce section' and set the status to Active.

    For background, here are several steps, or gates, that an issue must pass before it is marked RTBC and considered for commit. For most issues following step 10 in the Review a patch or merge request β†’ task of the Contributor guide β†’ is sufficient. The complete list of core gates β†’ has more topics. Also, check the tags on the issue and make sure they are complete.

  • πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne

    I experienced this issue today.

    I'm using Drupal v9.5.3 running on PHP 8.1. I am also using the latest version of the Conditional Fields module (v4.0.0-alpha2).

    To replicate, install the module, go to a content type and click on the `Manage Dependencies` tab. For me, I added a dependency on one filled to be visible when another field is `filled`. Then click "Add dependency". Like so:

    On the confirmation page, simply click `Save settings` to see the error:

  • πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne

    I can also confirm that the patch at #2 squashes the error message.

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia

    Reproduced error with conditional field multicardinality File control field, after editing a row and saving.

    This looks like a bug with conditional fields. \Drupal\conditional_fields\Form\ConditionalFieldEditForm::getDummyField. Its passing a singular form structure when the widget rightfully expects a multi form structure.

    I think this should be fixed in πŸ› Undefined offset error in FileWidget and ImageWidget Active .

Production build 0.71.5 2024