Problem/Motivation

The save hook reads every field item that is a FileItem, so a contrib field type whose item class extends FileItem is read like core's File and Image. The settings form, however, offers only bundles with a field of type file or image.

A bundle whose only file field is such a contrib type can still participate, set through Drush, a config import or a recipe, and its files are read. But the form does not show it, and it rebuilds the participating list from the checkboxes it showed, so the next save of the form, for any reason, removes that bundle and reading stops without a message.

Found in the review of 1.0.0-alpha1, from the code; the test for this issue will measure it.

Steps to reproduce

  1. Add a field of a contrib type whose item extends FileItem to a bundle with no core file or image field.
  2. Make that bundle participate in content_credentials.settings:participating through Drush or a config import.
  3. Open Configuration → Content authoring → Content credentials: the bundle is not listed.
  4. Save the form: the bundle is gone from participating.

Proposed resolution

Decide which bundles to offer the way the hook decides what to read: a field type counts when its item class is FileItem or a subclass of it. Core's File and Image stay as they are; a String field or an entity reference to a file still does not count.

Not in this issue: what the form does with a participating bundle that carries no file field at all. It reads nothing, so dropping it loses no reading.

Remaining tasks

  • Tests, then the fix.

User interface changes

The settings form also lists bundles whose file field is a contrib type built on core's file field.

Comments

maurice1969 created an issue. See original summary.

  • maurice1969 committed 76e38db8 on 1.0.x
    Issue #3631649 by maurice1969: SPEC 035 — offer every bundle whose files...

  • maurice1969 committed 76e38db8 on main
    Issue #3631649 by maurice1969: SPEC 035 — offer every bundle whose files...
maurice1969’s picture

Status: Active » Fixed

Committed to 1.0.x as 76e38db; CI green. The form now offers a bundle when any of its fields has items that are a FileItem, as the save hook decides. It will be in 1.0.0-alpha2.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.