Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291123

Add protected saveNew() and saveUpdated() methods to Field and FieldInstance to improve code readability

$
0
0

Problem/Motivation

  • This is a followup for #1735118: Convert Field API to CMI and postponed on that issue. Field::save() and FieldInstance::save() include long if/else statements that execute different logic based on whether a field or instance is new or updated.

Proposed resolution

  • Factor this logic out into two methods.

Remaining tasks

  • Create a patch that refactors save() in this way.
  • Propose how the hooks should be invoked with the refactor.

Viewing all articles
Browse latest Browse all 291123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>