payload icon indicating copy to clipboard operation
payload copied to clipboard

Lexical BlockFeature/UploadFeature: only media ID is retrieved if nested

Open pooledge opened this issue 1 year ago • 5 comments

Link to reproduction

No response

Describe the Bug

As soon as a media is attached within a nested lexical, only ID thereof is retrieved, despite setting depth query parameter to a very high value.

To Reproduce

  1. Attach a media to lexical either via Upload feature of by using a block with an image e.g. `type: 'upload', relationTo: 'media'
  2. Verify depth is set correctly and the whole image object is fetched as expected
  3. Now create a block featuring a nested rich text (I'm using an Array where a rich text is only field of an array item)
  4. Attach media to a nested lexical as described in pt.1
  5. Only media ID is being retrieved for an image field

Payload Version

2.0.14

Adapters and Plugins

richtext-lexical, db-mongodb, bundler-webpack

pooledge avatar Nov 03 '23 22:11 pooledge

Looks like this has been fixed on master. At least, I can't reproduce it. Another PR might have fixed it coincidentally.

You can expect the fix in v0.1.18 or higher of the lexical plugin! If there's still an issue in that version, please do open a new issue with a reproduction.

AlessioGr avatar Nov 14 '23 15:11 AlessioGr

@AlessioGr I am having this issue still. When fetching a collection that contains blocks, and those blocks contain rich text, which in turn contains more blocks, image relations are either not populated. When increasing the depth param, the image data is included but now the rich text content is not there.

stefvw93 avatar Dec 27 '23 15:12 stefvw93

@stefvw93 I'm dealing with this as well. What's interesting though is that I only have it on dev and not on production

TechSynthesis avatar Apr 09 '24 14:04 TechSynthesis

Okay the issue is now present on both local and production. On lexical with nested blocks, media just returns an ID. Are there any fixes for this? @AlessioGr @stefvw93 @pooledge

TechSynthesis avatar Apr 09 '24 21:04 TechSynthesis

Okay the issue is now present on both local and production. On lexical with nested blocks, media just returns an ID. Are there any fixes for this? @AlessioGr @stefvw93 @pooledge

For now I switched over to REST API

TechSynthesis avatar Apr 16 '24 18:04 TechSynthesis

I have tried to reproduce it again, but am sadly unable to. Due to that, I'll have to ask you to open up a new issue with a reproduction, following our reproduction guide.

If you can do that, and reproduce it with @payloadms/richtext-lexical 3.0.0-beta.36 or higher, I'm happy to look into this again ASAP :)

AlessioGr avatar May 29 '24 04:05 AlessioGr