diff --git a/src/actions/editorialWorkflow.js b/src/actions/editorialWorkflow.js index 98e48532..78ce594a 100644 --- a/src/actions/editorialWorkflow.js +++ b/src/actions/editorialWorkflow.js @@ -5,6 +5,7 @@ import { closeEntry } from './editor'; import { BEGIN, COMMIT, REVERT } from 'redux-optimist'; import { currentBackend } from '../backends/backend'; import { getAsset } from '../reducers'; +import { selectFields } from '../reducers/collections'; import { loadEntry } from './entries'; import { status, EDITORIAL_WORKFLOW } from '../constants/publishModes'; import { EditorialWorkflowError } from "../valueObjects/errors"; @@ -237,7 +238,8 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) { * Serialize the values of any fields with registered serializers, and * update the entry and entryDraft with the serialized values. */ - const serializedData = serializeValues(entryDraft.getIn(['entry', 'data']), collection.get('fields')); + const fields = selectFields(collection, entry.get('slug')); + const serializedData = serializeValues(entryDraft.getIn(['entry', 'data']), fields); const serializedEntry = entry.set('data', serializedData); const serializedEntryDraft = entryDraft.set('entry', serializedEntry); diff --git a/src/actions/entries.js b/src/actions/entries.js index 146d14c7..6efe6cfc 100644 --- a/src/actions/entries.js +++ b/src/actions/entries.js @@ -5,6 +5,7 @@ import { closeEntry } from './editor'; import { currentBackend } from '../backends/backend'; import { getIntegrationProvider } from '../integrations'; import { getAsset, selectIntegration } from '../reducers'; +import { selectFields } from '../reducers/collections'; import { createEntry } from '../valueObjects/Entry'; const { notifSend } = notifActions; @@ -276,7 +277,8 @@ export function persistEntry(collection) { * Serialize the values of any fields with registered serializers, and * update the entry and entryDraft with the serialized values. */ - const serializedData = serializeValues(entryDraft.getIn(['entry', 'data']), collection.get('fields')); + const fields = selectFields(collection, entry.get('slug')); + const serializedData = serializeValues(entryDraft.getIn(['entry', 'data']), fields); const serializedEntry = entry.set('data', serializedData); const serializedEntryDraft = entryDraft.set('entry', serializedEntry); dispatch(entryPersisting(collection, serializedEntry));