Some fields disappear after a "Clear all caches".

Steps to reproduce:
- Start with a fresh install of drupal 8
- Go to 'admin/structure/types/manage/article/fields'
- Add a new field of type entity_reference
- Do "Save" and "Save field settings"
- Select an content type for instance "article" and then click "Save settings"
- Go to 'admin/config/development/performance' and refresh the page
- Your new field of type entity_reference will be gone.

The problem is the clear all caches function also calls the function field_sync_field_status.
This function does also disables fields that belong to uninstalled modules.
This is to prefend the problem that a field needs a module that is no longer available.
The problem with the entity_refence field and other field_types that are located in drupal core is that the belong to "core".
And core is not in the list of installed modules and that means the the field get disabled and disappears from your site.

My solution is a small patch that adds the checking for the "core" module to the if-statement.
There are other posibilities to fix this problem and maybe they are better. Any ideas or suggestions are more then welcome.

Comments

daffie’s picture

My patch

swentel’s picture

Status: Active » Closed (duplicate)