When publish document with BagPart that contains content type with media field, media file did not save.
It stores empty images array to db. Text field is saved as it should.
Problem could be reproduced when BagPart is part or named part of document.
Could you provide some repro steps?
Which media editor?
I cannot repro this currently.
Hi @deanmarcussen ,
Package version "1.0.0-rc2-13535"
I have content type with TitlePart and media field (allow only one image, image is not required) - let's name it ContentType_One.
I have content type that has BagPart mapped to "ContentType_One" - let's name it ContentType_Two.
How to reproduce:
Add couple "ContentType_One" items with image to BagPart in "ContentType_Two" and try to publish.
As result TitlePart of "ContentType_One" saved, but media paths are empty
I could add that 1-1,5 months ago this functionality worked fine with package version "1.0.0-rc1-12821"
Can you include a screen shot, before (when media selected), and after publish (when media is lost)
Before 
After:

Path to image could not be saved ... looks like that "file upload" container was cleared on publish action
ok thanks, I can repro.
Most likely related to this pr https://github.com/OrchardCMS/OrchardCore/pull/5906 as I know you said you had some problems with the media app @agriffard ?
I can revert back to before jQuery 3.5.1 and it works ok.
I know @jtkech put this one in to, https://github.com/OrchardCMS/OrchardCore/pull/6361, but I don't see anything that's likely to be causing this in it
Nope, I think I'm wrong, and it's not the jQuery 3.5.1 upgrade
its this one https://github.com/OrchardCMS/OrchardCore/pull/6361
Sorry @jtkech :(
Looks like it's happening on create of anything with a media image in it. Not just bag items
@deanmarcussen
Oops it fixed #6102 (confirmed by @johnrom) but sorry it introduced a new one
I think it will not be so hard to fix, can't right now but i will dig into it this night and fix it
the Paths hidden input field doesn't be updated. After upload an image (with media field in "attached" mode) or load an image (with media field in "normal" mode ) the initialized prop is set to false in the get: method of the computed paths field.
(I believe to have write something incomprehensible)
I suppose the problem could be in the files mediafield.js (from line 26 to 76) and attachedMediaField.js (from line 26 to 76).
Hope to be useful in some way. 馃槄
Hmm, I didn't look too deeply since #6361 was already merged before I reviewed it. Sorry for missing this issue!
I just made sure existing images didn't disappear, which was my initial issue.
Okay i could repro, as @johnrom said existing images don't disappear as in the initial issue
But now we can't add an image if there is not an existing one, i will work on it soon and fix it
@deanmarcussen @johnrom @PiemP
Fixed ;)
I will do some additional tests
@jtkech 馃憤
Most helpful comment
@deanmarcussen @johnrom @PiemP
Fixed ;)
I will do some additional tests