mb3: Digitizer / Trigger Problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

mb3: Digitizer / Trigger Problem

v.botz
Hi,

i want to use mapbender 3 for an attribute editing tool.
> change attributes on geometries via a gui...
in principel it works fine with the digitizer function.

But if i use a trigger / function on the table i am editing, i got errors (without trigger everything is fine).
If i start the trigger with sql it works fine!

Error in dev log:    emergency: Call to a member function getId() on boolean...

My Trigger / Function:

CREATE TRIGGER a_delete_el_alle
        AFTER UPDATE
        ON weinbau_edit.el_alle_alkis_liste
        FOR EACH ROW
        EXECUTE PROCEDURE a_delete_el_alle();

CREATE OR REPLACE FUNCTION a_delete_el_alle() RETURNS TRIGGER AS $$
        BEGIN
         INSERT INTO weinbau_edit.el_alle_alkis (code, the_geom, wlg_nr, erfasser, stand)
         (select  code, NEW.the_geom, NEW.wlg_nr, 'engisch_gis', now() from weinbau_edit.el_alle_alkis_liste where code = NEW.code);
         delete from weinbau_edit.el_alle_alkis_liste where code = NEW.code;
     RETURN NULL;
         END;
 $$ LANGUAGE plpgsql;


Has anyone an idea what the problem is ???

Thanx Volk.
Reply | Threaded
Open this post in threaded view
|

Re: mb3: Digitizer / Trigger Problem

Astrid Emde (WhereGroup)
Hello,

does your table contains oids?

You should use a table without without oids.

There is also a new digitizer version coming soon with the new
Mapbender3 version. The problem should be fixed there.

Astrid

Am 2017-01-30 17:11, schrieb v.botz:

> Hi,
>
> i want to use mapbender 3 for an attribute editing tool.
>> change attributes on geometries via a gui...
> *in principel it works fine with the digitizer function. *
>
> *But if i use a trigger / function on the table i am editing, i got
> errors
> (without trigger everything is fine).*
> If i start the trigger with sql it works fine!
>
> *Error in dev log:    emergency: Call to a member function getId() on
> boolean...*
>
> My Trigger / Function:
> /
> CREATE TRIGGER a_delete_el_alle
>         AFTER UPDATE
>         ON weinbau_edit.el_alle_alkis_liste
>         FOR EACH ROW
>         EXECUTE PROCEDURE a_delete_el_alle();
>
> CREATE OR REPLACE FUNCTION a_delete_el_alle() RETURNS TRIGGER AS $$
>         BEGIN
>          INSERT INTO weinbau_edit.el_alle_alkis (code, the_geom,
> wlg_nr,
> erfasser, stand)
> (select  code, NEW.the_geom, NEW.wlg_nr, 'engisch_gis', now() from
> weinbau_edit.el_alle_alkis_liste where code = NEW.code);
> delete from weinbau_edit.el_alle_alkis_liste where code = NEW.code;
>      RETURN NULL;
>          END;
>  $$ LANGUAGE plpgsql;/
>
> Has anyone an idea what the problem is ???
>
> Thanx Volk.
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/mb3-Digitizer-Trigger-Problem-tp5305326.html
> Sent from the mapbender-users mailing list archive at Nabble.com.
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapbender_users

--
Mit freundlichen Grüßen

Astrid Emde
GIS-Consultant

*********************************************************
FOSS Academy Winterschule 2017
20.-24.03.2017 in Bonn
Alles Wichtige zur Erstellung einer GDI in nur 5 Tagen!
*********************************************************

  Astrid Emde
  WhereGroup GmbH & Co.KG
  Eifelstraße 7
  53119 Bonn
  Germany

  Fon: +49(0)228 90 90 38 - 22
  Fax: +49(0)228 90 90 38 - 11

  [hidden email]
  www.wheregroup.com

  Folgen Sie der WhereGroup auf twitter:
http://twitter.com/WhereGroup_com

Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
-------------------------------
  pgp-public key:
  http://pgp.mit.edu:11371/pks/lookup?search=0x06DA52D72D515284
  Signierte und/oder verschlüsselte Nachrichten sind sehr willkommen
  Signed and/or encrypted mail is highly appreciated
_______________________________________________
Mapbender_users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapbender_users
Reply | Threaded
Open this post in threaded view
|

Re: mb3: Digitizer / Trigger Problem

v.botz
Hi,

thanks for the note, changed from oid to gid, but it doesn't fix the problem.

i think it is a problem with the delete statement, without if works fine....

dev.log:
[2017-02-10 09:12:05] doctrine.DEBUG: SELECT column_name FROM information_schema.columns WHERE (table_schema || '.' || table_name = 'weinbau_edit.el_alkis_liste' OR table_name = 'weinbau_edit.el_alkis_liste') [] []
[2017-02-10 09:12:05] doctrine.DEBUG: SELECT ST_TRANSFORM(ST_GEOMFROMTEXT('SRID=25832;MULTIPOLYGON(((407733.64699998 5558118.6469996,407732.75999998 5558104.9959996,407762.99499998 5558104.5569996,407733.64699998 5558118.6469996)))'), 25832) [] []
[2017-02-10 09:12:05] doctrine.DEBUG: UPDATE weinbau_edit.el_alkis_liste SET wlg_nr = ?, the_geom = ? WHERE gid = ? ["320505","0106000020E864000001000000 [...]",70] []
[2017-02-10 09:12:05] doctrine.DEBUG: SELECT gid, ST_ASTEXT(ST_TRANSFORM(the_geom, 25832)) AS the_geom, code, wlg_nr, prozent, gid FROM weinbau_edit.el_alkis_liste t WHERE gid = :id {"id":70} []
[2017-02-10 09:12:05] emergency.EMERGENCY: Call to a member function getId() on boolean {"type":1,"file":"/var/www/html/mapbender3/vendor/mapbender/digitizer/Mapbender/DigitizerBundle/Element/Digitizer.php","line":229} []

in this case, i could wait for the next release ;-)

thanks V°