Cloning a field from one entity type to another leaves the cloned field with a config dependency on the storage on the source entity type.

This is automatically updated and fixed on next config import.

CommentFileSizeAuthor
#5 2849461-5.patch988 bytesarthur_lorenz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

geek-merlin’s picture

Priority: Minor » Major

Ups, ran into this. 'drush cim -y' seemed not to fix this here. Even worse, when i delete the source field storage, the cloned field (containing the dependency) is deleted. Raising prio thus.

arthur_lorenz’s picture

I came across the same issue and had to manually remove the dependency from yml files and import it again. Very inconvinient.

joachim’s picture

This module only really gets attention from me when I'm using it for site building... if someone could work on a patch that would be great! :)

arthur_lorenz’s picture

Status: Active » Needs review
FileSize
988 bytes

Problem was that when a new field storage was created the new field referred to the old storage. My patch fixes that.

joachim’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for the patch!

Possibly just a nitpick, but:

if ($new_field_storage_config instanceof FieldStorageConfigInterface) {

when would it not be an instance of that?

arthur_lorenz’s picture

Status: Postponed (maintainer needs more info) » Needs review

It's possible that this variable doesn't exist at this point, e.g. if no new storage needed to be created.

  • joachim committed a3cafc7 on 8.x-1.x authored by arthur_lorenz
    Issue #2849461 by arthur_lorenz: Fixed field config not getting updated...
joachim’s picture

Status: Needs review » Fixed

Ah ok.

I think in that case it makes more sense to say

      if (isset($new_field_storage_config)) {

because what we care about is whether the variable was set, not what type it is.

I've committed the patch with that change.

Thanks again!

Status: Fixed » Closed (fixed)

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