Problem/Motivation

This module currently creates custom block type with the entity reference field on it. That entity reference field uses entity browser to attach images to that block. This is amazing as we demonstrate how custom blocks work and how entity browser can be used to improve media-related experience.

It would be nice if we would do something similar with a content type and a field on it.

Proposed resolution

- Create custom content type
- Add body and entity reference fields on it
- Configure entity reference field similar to what we currently have on custom block (references files, uses entity browser to upload/pick from library).
- Export all related configuration and put it in config/install folder in this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

slashrsm created an issue. See original summary.

slashrsm’s picture

Issue summary: View changes
devlada’s picture

Assigned: Unassigned » devlada

Assigning issue to myself.

devlada’s picture

Status: Active » Needs review
FileSize
665 bytes

Please review.

devlada’s picture

Status: Needs review » Needs work

It seems to me that the patch is not complete.

devlada’s picture

Status: Needs work » Needs review
FileSize
6.52 KB
6.23 KB

Completed and tested. Please review now.

devlada’s picture

Note that we use custom body field (field_body) to avoid conflict with already existing body field. Also when try to install File Browser with Entity Browser example module, getting error message that fields or settings already exist, also on module uninstall seems as settings remains in the database and on reactivation getting an error too.

I'll describe step by step what happens in the morning. Perhaps these configurations should be separated as example module and generally we should take care of conflicts.

samuel.mortenson’s picture

FileSize
3.38 KB
5.87 KB

Committed, thanks @devlada! I didn't see any errors, but one change I made before committing the patch was to remove field_body and replace it with a "body" field instance (not storage). The only conflict this could have is if a site had deleted every instance of the "body" field before enabling file_browser, which is really unlikely.

samuel.mortenson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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