diff --git a/packages/next/src/routes/rest/buildFormState.ts b/packages/next/src/routes/rest/buildFormState.ts index 0ca4d5201..90466f5bd 100644 --- a/packages/next/src/routes/rest/buildFormState.ts +++ b/packages/next/src/routes/rest/buildFormState.ts @@ -14,7 +14,6 @@ import httpStatus from 'http-status' import type { FieldSchemaMap } from '../../utilities/buildFieldSchemaMap/types.js' import { buildFieldSchemaMap } from '../../utilities/buildFieldSchemaMap/index.js' -import { routeError } from './routeError.js' let cached = global._payload_fieldSchemaMap diff --git a/packages/payload/src/fields/validations.ts b/packages/payload/src/fields/validations.ts index 2e57e824e..5744be5e4 100644 --- a/packages/payload/src/fields/validations.ts +++ b/packages/payload/src/fields/validations.ts @@ -399,6 +399,8 @@ const validateFilterOptions: Validate< return true } + if (!options[collection]) return true + return options[collection].indexOf(requestedID) === -1 }) diff --git a/packages/richtext-slate/src/field/elements/relationship/Element/index.tsx b/packages/richtext-slate/src/field/elements/relationship/Element/index.tsx index 48f0595f0..fe933b49a 100644 --- a/packages/richtext-slate/src/field/elements/relationship/Element/index.tsx +++ b/packages/richtext-slate/src/field/elements/relationship/Element/index.tsx @@ -52,6 +52,7 @@ const RelationshipElement: React.FC = () => { const [relatedCollection, setRelatedCollection] = useState(() => collections.find((coll) => coll.slug === relationTo), ) + const selected = useSelected() const focused = useFocused() const { i18n, t } = useTranslation()