Opened 12 years ago
Closed 12 years ago
#955 closed defect (fixed)
deleting schema plugin - seems to remove all other templates.
Reported by: | ianwallen | Owned by: | simonp |
---|---|---|---|
Priority: | major | Milestone: | v2.8.0 |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Removing a schema after it has been installed seems to break the templates.
Steps to reproduce from a fresh installation of geonetwork.
1 - Install plugin via web interface (administration -> Add a metadata schema/profile) - in this case I used the one from the repository schemaPlugins/trunk/iso19139.mcp
2 - add templates for new schema plugin that was uploaded.
3 - Also add templates for iso19139
4 - Going to Administration -> New metadata - shows list of the templates - both from MCP and also from iso19139
5 - Remove plugin using web interface (administration -> Delete a metadata schema/profile)
6 - Going to Administration -> New metadata - shows error "No templates available, import metadata first." I was expecting to still see the iso19139 templates?
7 - Adding a template for any of the remaining schema does not solve the issue. (even though it said that they were added successfully and I can see them in the database) 8 - re-installing the mcp pluging fixes the issue. All the templates were working again.
Also noticed that removing a schema does not remove the templates that were installed from the schema plugin.
Windows XP Oracle 11G Geonetwork 2012-06-12 nightly build 2.8 branch
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
No templates are actually being deleted - the guiservice that generates the list of templates to display actually calls an xslt to process the results of a search for template records - this xslt fails because the search returns template records that belong to the deleted schema and they can't be processed.
However I think the guiservice could now use fast=index when it searches for the template records and avoid this issue as this will provide all the geonet:info fields it needs. I'll prepare a fix for this based on this approach.
Can decide on whether to allow a schema to be deleted if records still exist with that schema later (after 2.8.x maybe?).
comment:3 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in github commit https://github.com/geonetwork/core-geonetwork/commit/9383aaafdbe066e0c17e41a1cb2edf40a3b5f57f
Don't allow schema to be deleted if records using that schema still exist
I also noticed that if I add content before I delete the schema then after the schema is deleted, searching for the content give me "XPathException : Template iso19139.mcpBrief has not been defined"
Maybe it should not allow the removal of a schema if there is data associated?