Fun fact about config system: deleting any config also deletes all configs which dependent on it.
So, if you delete a field that's mapped, the entire mapping gets deleted.
This is not the behavior we want.

What we would like is (at least):
* When deleting a field, notify admin that it's in use by a mapping
** Optionally admins from being allowed to delete a field that's in use by a mapping
* If a field has been deleted or is otherwise missing, mark the field as broken on the mapping but don't destroy the mapping altogether
* In the UI, flag the mapping as problematic (similar to how rules calls out errors)

Comments

aaronbauman created an issue. See original summary.

jonnyeom’s picture

I believe that having field-level dependencies does make sense. We just have to make sure the mapping does not depend on any field that we are about to delete.
A similar situation can be seen with views and its dependencies.

One problem I am seeing is that mappings are not successfully removing field dependencies, even when I unmap a certain drupal field.

Steps to Reproduce:
1. Map a Drupal field > This will make this field a dependency.
2. Unmap that field.
3. That field will still remain a dependency, and I will have to manually delete it from the config.

Thoughts?

aaronbauman’s picture

What I observed is that, when a dependent field was deleted, the entire mapping was also deleted.

If we can figure out how to get around that, I'm happy to restore field dependencies.

aaronbauman’s picture

Title: Remove field-level dependencies from mappings » Restore some kind of field-level dependencies to mappings that don't delete mappings when fields are deleted
Issue summary: View changes
Issue tags: -Release blocker

Hard dependencies on fields have been removed for the time being.

Changing title and description to reflect discussion

  • AaronBauman committed 772a3e1 on 2919376
    Issue #2919376 - Implement field-level dependencies for Mappings
    
aaronbauman’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
Status: Active » Needs review
StatusFileSize
new23.07 KB

PR open over on github: https://github.com/messageagency/sfd8/pull/8

This will probably only get into 4.x since it includes some minor but non-trivial API changes.

Status: Needs review » Needs work

The last submitted patch, 6: salesforce-config_dependencies-2919376.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

aaronbauman’s picture

Status: Needs work » Needs review
StatusFileSize
new23.49 KB

  • AaronBauman committed 5dc5378 on 8.x-4.x
    Issue #2919376 by AaronBauman: Restore field-level dependencies to...
  • AaronBauman committed 772a3e1 on 8.x-4.x, 2919376
    Issue #2919376 - Implement field-level dependencies for Mappings
    
aaronbauman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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