cerpus / Edlib

Edlib is an application for creating, sharing, storing and using rich interactive learning resources.
https://docs.edlib.com
GNU General Public License v3.0
40 stars 7 forks source link

CA Admin: Libraries / Content types that are used can be deleted #2660

Open chrieinv opened 7 months ago

chrieinv commented 7 months ago

It's possible to delete a library/content type in the CA Admin. Only libraries/content types that are without content, or not required by other can be deleted. This check only uses data from library.json, so any content types/libraries dependencies that is in semantics.json will not be checked.

Example: The content type H5P.ImageSlider uses the H5P.ImageSlide library. This usage is set in the semantics.json file, there is no usage set in the library.json file, and since CA Admin uses data based on the library.json it shows that no other library has a dependency to H5P.ImageSlide library and allows deletion of the library.

Suggested solution When content is stored, libraries the content depends on is stored in a separate table, this table should also be used when deciding if a library can be deleted