• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atsanna / Bonfire2 / 44523311769

18 Nov 2026 10:17AM UTC coverage: 78.956% (+0.6%) from 78.396%
44523311769

push

github

web-flow
feat(#878): add file and image field types (#884)

* feat(#878): add file and image field types

A file field picks one media file and stores its ID; an image field does
the same but only takes files with an image/* mime. Both refuse an ID that
is unknown or in the Recycler, so a broken reference can't be saved.
Registered as module types from Media, which Config may now depend on.

Red before the types existed:

  1) Tests\Media\FileFieldTest::testStoresThePickedId with data set "file"
  Error: Class name must be a valid object or a string
  src/Fields/FieldTypes.php:60

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(#878): add the media picker for file and image fields

GET admin/media/picker returns the body of a field's picker: the folders,
a search, the files to pick (images only for ?type=image) and, with
media.edit, an upload form. An upload posted from the picker goes back to
the picker in its folder instead of the media list. The list and picker
share the folder and search filter.

Red before the route existed:

  5) MediaPickerTest::testAnUploadFromThePickerGoesBackToThePickerInItsFolder
  Redirect URL 'http://example.com/index.php?type=image&folder=pets' does not
  match 'http://example.com/index.php/admin/media?folder=pets'.
  4) MediaPickerTest::testTheUploadFormIsHiddenWithoutMediaEdit
  Failed asserting that 0 is identical to 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(#878): add the media() helper

media($id) gives the live media file a file or image field holds, or null
for an empty field or a file that is gone, so a site can write
media($entry->photo)?->url(). Controllers load it with the other helpers.

Red before the helper existed:

  1) MediaModelTest::testTheMediaHelperGivesALiveFileAndNullOtherwise
  Error: Call to undefined function Tests\Media\media()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(#878): add the file and image field input

The input shows the picked f... (continued)

64 of 64 new or added lines in 9 files covered. (100.0%)

12 existing lines in 5 files now uncovered.

8183 of 10364 relevant lines covered (78.96%)

175.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.0
/src/Resources/Controllers/ResourceController.php


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc