#Payload Admin Document Edit Field Issue

15 messages · Page 1 of 1 (latest)

zenith hollowBOT
#

hey guys just started using payload today with my next.js project with mongodb. when i go to /admin i can see the documents, but then when i go to edit the document the value is blank when i reasonably expected it to be the current set value of the field since i am editing it. is there a config for this that i am missing. When i put a default value on the CollectionConfig, the temp_def value comes up but not the expected currently set value
const Blogs: CollectionConfig = {
slug: 'blogs',
dbName: 'Blogs',
timestamps: false,
fields: [
{ name: 'title', type: 'text', defaultValue: 'temp_def' },
{ name: 'slug', type: 'text', unique: true },
{ name: 'category', type: 'text', required: true },
{ name: 'categorySlug', type: 'text', required: true },
{ name: 'publishedOn', type: 'text' },
{
name: 'tags',
type: 'text',
hasMany: true,
},
{ name: 'coverImage', type: 'text' },

{ name: 'content', type: 'textarea' },
{ name: 'updatedAt', type: 'date' },
{ name: 'schemaVersion', type: 'number' },
{
  name: 'status',
  type: 'select',
  options: ['Draft', 'InReview', 'ReReview', 'Reviewed', 'Published'],
  defaultValue: 'Draft',
},
{
  name: 'authorId',
  type: 'relationship',
  relationTo: 'authors',
}

],
}

here are the versions of payload :
"@payloadcms/db-mongodb": "^3.46.0",
"@payloadcms/next": "^3.46.0",
"@payloadcms/richtext-lexical": "^3.46.0",
"payload": "^3.46.0",

twilit ventureBOT
#

Original message from @manic mica - Moved from #general message

inland plover
#

Seems like you're trying to edit your documents through the Bulk Edit drawer. This let's you select the fields to edit. If you have documents with different field values, it will show up blank because it's a bulk editing operation.

Instead, you should navigate to the doc by clicking the link in the first row. There your document will have the correct field value.

manic mica
#

even when editing just one document, the field is blank, so i tried creating a new payload project once with mongo and once with postgres and they have the same problem even with the default user and media collections

#

couple questions . is this supposed to happen? are there any configs that i should do for the previous value to be visible when editing a document?

inland plover
#

I mean the reason why this is happening to you is because you are bulk editing, as is visible in your image above

#

If you navigate to the actual document, the field should be populated with whatever you had

#

In Bulk Edit view, the fields are intentionally blank

#

In proper document edit view, they are whatever you filled them in with

manic mica
#

ahhhhhhhhhhhhhh my bad dude

#

i thought if i select one, it would be considered as editing one

#

thanks

inland plover
#

Hahaha no worries, yeah I had a hard time trying to explain the difference here between the two views 😅

#

Glad we figured it out in the end though, and my pleasure my friend