Media: Properly reset the "add to gallery" library to ensure it accurately reflects the current gallery. see #22815.
git-svn-id: https://develop.svn.wordpress.org/trunk@23263 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dec369d6c8
commit
0221f597b4
@ -661,6 +661,10 @@
|
||||
return !! this.mirroring.getByCid( attachment.cid ) && ! edit.getByCid( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
|
||||
};
|
||||
|
||||
// Reset the library to ensure that all attachments are re-added
|
||||
// to the collection. Do so silently, as calling `observe` will
|
||||
// trigger the `reset` event.
|
||||
library.reset( library.mirroring.models, { silent: true });
|
||||
library.observe( edit );
|
||||
this.editLibrary = edit;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user