[Mapbender-commits] r9860 - trunk/mapbender/resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Feb 6 03:20:31 PST 2018
Author: armin11
Date: 2018-02-06 03:20:31 -0800 (Tue, 06 Feb 2018)
New Revision: 9860
Modified:
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Fix for 0 values in fkey_mb_group_id
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2018-02-06 09:13:13 UTC (rev 9859)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2018-02-06 11:20:31 UTC (rev 9860)
@@ -2292,6 +2292,7 @@
OWNER TO postgres;
-- new function to pull responsible organization
+
-- Function: f_get_responsible_organization_for_ressource(integer, varchar)
-- DROP FUNCTION f_get_responsible_organization_for_ressource(integer, varchar);
@@ -2307,21 +2308,21 @@
IF s_ressource_type='metadata' THEN
i_resp_orga_id := fkey_mb_group_id FROM mb_metadata WHERE metadata_id = i_ressource_id;
- IF i_resp_orga_id IS NULL THEN
+ IF i_resp_orga_id IS NULL OR i_resp_orga_id = 0 THEN
--get primary group for fkey_user_id
i_resp_orga_id := fkey_mb_group_id FROM mb_user_mb_group WHERE mb_user_mb_group_type = 2 AND fkey_mb_user_id = (SELECT fkey_mb_user_id FROM mb_metadata WHERE metadata_id = i_ressource_id) LIMIT 1;
--get primary group for fkey_user_id
END IF;
ELSIF s_ressource_type='wms' THEN
i_resp_orga_id := fkey_mb_group_id FROM wms WHERE wms_id = i_ressource_id;
- IF i_resp_orga_id IS NULL THEN
+ IF i_resp_orga_id IS NULL OR i_resp_orga_id = 0THEN
--get primary group for fkey_user_id
i_resp_orga_id := fkey_mb_group_id FROM mb_user_mb_group WHERE mb_user_mb_group_type = 2 AND fkey_mb_user_id = (SELECT wms_owner FROM wms WHERE wms_id = i_ressource_id) LIMIT 1;
--get primary group for fkey_user_id
END IF;
ELSIF s_ressource_type='wfs' THEN
i_resp_orga_id := fkey_mb_group_id FROM wfs WHERE wfs_id = i_ressource_id;
- IF i_resp_orga_id IS NULL THEN
+ IF i_resp_orga_id IS NULL OR i_resp_orga_id = 0 THEN
--get primary group for fkey_user_id
i_resp_orga_id := fkey_mb_group_id FROM mb_user_mb_group WHERE mb_user_mb_group_type = 2 AND fkey_mb_user_id = (SELECT wfs_owner FROM wfs WHERE wfs_id = i_ressource_id) LIMIT 1;
--get primary group for fkey_user_id
More information about the Mapbender_commits
mailing list