Extracted from #1626584: Combine configuration system changes to verify they are compatible

Problem

  • Various code needs to check whether the config object returned by config('foo.bar') already exists or not, but has no way to do so.

Goal

  • Allow code to check $config->isNew() to determine storage status.

Proposed solution

  1. Add public Config::isNew() method.
  2. Change configuration storage controllers to make a difference between non-existing and existing storage items/records/entries.

Notes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

FileSize
597 bytes
10.28 KB

bd79424 Fixed fatal error in image_style_load().

chx’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
669 bytes
10.45 KB

I like this but I have made Config::load() just a little bit more explicit to make it more readable. (Previous patch was testing for $data === FALSE twice)

sun’s picture

FileSize
908 bytes
11.15 KB

Just ran across another @todo that should be killed by this patch.

3d05a48 Leverage isNew() in image_style_save(), too.

Leaving RTBC, since that change is trivial.

chx’s picture

Oh great!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense to me.

Committed and pushed to 8.x. Thanks!

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.