Problem/Motivation

File entity provides field widgets for core file and image fields that use Entity browser for selection. File entity browser provided very similar widgets. To prevent redundant implementations we decided to merge and move them to the Entity browser itself, which happened in #2763505: Move file_entity and file_browser's Field Widget for Files and Images to Entity Browser.

Proposed resolution

Deprecate field widgets provided by file entity. Provide BC layer that will prevent duplicate widgets from appearing in UI. Idea was proposed in #2763505-4: Move file_entity and file_browser's Field Widget for Files and Images to Entity Browser.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

slashrsm created an issue. See original summary.

tlyngej’s picture

Just to get something started (and my website back to a state where it is working) I'll post a patch that deletes the FileEntityBrowser class and the entity browser related settings in the schema.yml file.

Berdir’s picture

Status: Active » Needs review

Here's a patch that keeps the class empty and extend from the one. Haven't tested it yet, doing that now.

Berdir’s picture

Berdir’s picture

The last submitted patch, 2: 2767185-depricate_entity_browser_widget-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: file_entity-browser-2769695-3.patch, failed testing.

The last submitted patch, 5: file_entity-browser-2769695-3.patch, failed testing.

The last submitted patch, 2: 2767185-depricate_entity_browser_widget-2.patch, failed testing.

Berdir’s picture

Berdir’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: file_entity-browser-2769695-10.patch, failed testing.

The last submitted patch, 10: file_entity-browser-2769695-10.patch, failed testing.

dmsmidt’s picture

Added @depricated to the comment block.

Berdir’s picture

Discussed with @slashrsm. Tests aren't working because this relies on entity_browser, it fails if that module is not around. Note that this was a problem since this feature was added.

Due to that, we agreed that the best way forward is probably in fact going back to #2, deleting it. But we also need an update function then that looks at all form displays and tries to find a component that uses this and replaces it with the entity browser replacement.

dmsmidt’s picture

@Berdir, yes that would be a better approach imho, since it leaves you with a cleaner state of a site.
That way we also don't have to figure out how to not show the widget in the UI.

Berdir’s picture

Ok, here is a patch that does exactly that.

Worked fine here on one site, some additional confirmations would be great.

Status: Needs review » Needs work

The last submitted patch, 17: file_entity-browser-2767185-17.patch, failed testing.

Michelle’s picture

This patched fixed the broken form display config problem for me. Thanks!

Berdir’s picture

Fixing the failing tests. Unrelated, but wouldn't be possible to make them work without removing this class, so combining into a single test. interdiff does apply separately but will fail.

The last submitted patch, 20: unneeded_parameters-2775173-6.patch, failed testing.

The last submitted patch, 21: file_entity-browser-2767185-20-interdiff.patch, failed testing.

slashrsm’s picture

+++ b/file_entity.install
@@ -98,3 +98,28 @@ function file_entity_update_8002(&$sandbox) {
+
+  /** @var \Drupal\Core\Entity\Entity\EntityFormDisplay $form_display */
+  foreach (EntityFormDisplay::loadMultiple() as $form_display) {

Should we check version of Entity browser and fail if it is not >= alpha7?

Berdir’s picture

Hm, version checking is not reliable with git checkouts and so on.

We could check if the widget exists, but accessing that in an update function is also tricky, as the caches might not have been rebuild. Version dependency is also not possible as it not a dependency.

I'd just commit it, do a new release and put it in the release notes as a bold notice..

slashrsm’s picture

Status: Needs review » Reviewed & tested by the community

OK.

slashrsm’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks.

  • slashrsm committed 1af9fe0 on 8.x-2.x authored by Berdir
    Issue #2767185 by Berdir, dmsmidt, tlyngej: Deprecate file/image field...

The last submitted patch, 17: file_entity-browser-2767185-17.patch, failed testing.

The last submitted patch, 20: unneeded_parameters-2775173-6.patch, failed testing.

The last submitted patch, 21: file_entity-browser-2767185-20-interdiff.patch, failed testing.

Status: Fixed » Closed (fixed)

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