-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't remove items from media library #11
Comments
Thanks for reporting @patrickdaley! This is probably a “not a bug, but a feature”. The backend doesn't let you remove documents with incoming (strong) references. This is to prevent you from unintentionally breaking something in another document that might rely on the asset existing. Did you remove the video reference from the |
Hi @kmelve! That reference is the active draft. Because you need to be in the interface for adding the asset to remove it, it's counted as referenced by the same draft you're trying to use to remove it. Hope that makes sense! |
+1 that currently open draft is preventing the item from being removed |
I can also confim that this makes it kind of impossible to remove a video from the studio interface. |
I would also like to bump this. Is there a timeframe for when we can expect this to be fixed or does anyone have a workaround? Edit: You also can't remove the credentials, leaving the fields empty doesn't remove the data. |
I needed this for a client asap so I published a fork to npm with some updates. Rush-job so not 100% tested yet but seems to work so far. I added the new sanity ui components and fixed some visual bugs too (checkbox labels not visible etc). If you're reading this and are in the same situation - please feel free to try it out by running |
@KimPaow Thanks for the fork! Working great so far! 😃 Also love the refactor to Sanity UI! Could you maybe open a pull request? |
Struggling with this today, client can't remove a video from their page so I had to go into the frontend codebase and disable it manually, very frustrating. |
@gristleism what version of the plugin are you on? I believe this was added back since v1.0.0 |
My |
Yep, this was added since v1.0.0. @gristleism could you also share what version of the studio you have? |
@KimPaow happy to! Would you mind letting me know where I can find which version of the studio I'm using? |
@gristleism you can run |
Results from initial run:
I then ran
Running again locally, I attempted to delete a video file again and received the following error:
|
@gristleism I just tried running this with the same dependencies you listed here and am unable to reproduce it. Maybe try deleting node-modules and lock files and then reinstall all packages. |
Same "not a bug" issue, but the problem is that i don't anymore have access to the drafts.xxxxxxxxxx, as i made mutations that deleted the schema of this object/document that refers to the other document i want to delete. So it doesn't exist anymore in my Sanity Studio. Is there anyway to access it via url and its id drafts.xxxxx ? |
@JulienDesmettre You can access the document directly by running |
Thanks for your answer geball. Yes i found it on Sanity CLI doc just few minutes after my question here. |
Ran into this issue as well. The issue happens when the
Currently I have no way of deleting my video assets Here is a small screen recording for reference: |
I have the same issue. As described by @jimmi-joensson it is impossible to delete videos inside the studio, because they have to be added to a document to access the delete button (and therefore can't be deleted as there are references to it). Maybe it would be a good idea to have a delete button inside the browse/select grid (just like we have inside the image select grid) |
Did anyone manage to find a way through this? Multiple versions later and this is still a problem, totally unable to remove a video from a field. Seems to be a very core functionality that bugs out and certainly getting in the way of using Mux in this project. |
Just checking in to see if anyone figured out a solution to this? I am in the same boat as others above... The plugin still does not allow a video to be removed and when I create a separate module/page section containing a mux component, the plugin breaks with a
On top of this, if I delete a video within the Mux dashboard the videos are not updated within the @kmelve is there any timeframe on this fix? This is the only breaking change that is really holding myself and many developers back from using this plugin/going with Mux over another video service. |
Facing the exact same issue on my end as well. Unable to remove a video. Looking for a fix. |
It does seem to work in the new Sanity Studio v3 using version 2.0.2 of the plugin. The videos in the select grid have a delete option where you can delete the video from the dataset and also from Mux. |
Closing this issue as deleting assets is now fully supported and respects strong references being used. Thank you all for showing up, keeping track of updates and helping debug 🙏 |
It looks like the draft that contains the interface for removing items blocks the removal action:
"The mutation(s) failed: Document "b430b968-9037-44ab-9878-28376fb86d08" cannot be deleted as there are references to it from "drafts.b32572a0-8c4f-43f5-acc1-edf0f6ac9b64""
The text was updated successfully, but these errors were encountered: