Commit b906529b authored by Christopher C. Wells's avatar Christopher C. Wells Committed by Jordan Thompson
Browse files

Issue #3261891 by wells: Post update hook fails when config is already updated

parent 7b7e7d9a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ function allowed_formats_post_update_store_allowed_formats_as_sequence() {
    if (in_array($field_config->getType(), _allowed_formats_field_types(), TRUE)) {
      $allowed_formats = $field_config->getThirdPartySettings('allowed_formats');
      if (!empty($allowed_formats)) {
        // Don't do anything if the configuration is already a sequence.
        if (isset($allowed_formats['allowed_formats']) && is_array($allowed_formats['allowed_formats'])) {
          continue;
        }
        // Unset existing configuration.
        foreach ($allowed_formats as $key => $value) {
          $field_config->unsetThirdPartySetting('allowed_formats', $key);