[Cartoweb-users] edit_sel works incorrectly

Igor Evdokimov igev at mail.ru
Thu Apr 5 06:14:54 EDT 2007


Hi, List!

I have one error while working with Edit plugin.

I have 2 PostGIS layers in my map (point and line).
I can create points and lines with attributes - all is fine, no problems.
QUERY tool on these inserted objects - works well.
But selection tool ('edit_sel') does not.

I see the following:
after I had selected 'edit_sel' button in toolbar and selected Rectangle
region on map - nothing happens. But in 'demoEdit' project this function works!
I can't found any serious difference between 'demoEdit' options and options
of 'myProject'.


I've turned on 'debugging' and can now understand that:

1)  at <plugins/edit/client/ClientEdit.php>:

     public function handleHttpPostRequest($request) {

         $shape = $this->cartoclient->getHttpRequestHandler()->handleTools($this);

         // when receiving $shape value : <handleTools> returns NOTHING == 0 !!!

         ...
         // selection tool selected
         $tool = $this->getHttpValue($request, 'tool');
         $this->editSelection = ($tool == 'edit_sel' && $shape);

         ...

         // so here $this->editSelection == 0, but $tool == 'edit_sel'

2) at <client/HttpRequestHandler.php>:

     public function handleTools(ClientPlugin $plugin) {

         if (!$plugin instanceof ToolProvider) {
             throw new CartoclientException("tool $plugin is not a tool provider");
             return;
         }

         if (!array_key_exists('tool', $_REQUEST)) {
             $this->log->debug('no tool selected, skipping');
             return;
         }
         $toolRequest = $_REQUEST['tool'];

         $tools = $this->cartoclient->getPluginManager()->
                 callPluginImplementing($plugin, 'ToolProvider', 'getTools');

         ...

     I see here that <$tools> array for <ClientEdit> plugin is empty,
     so no tool, no shape is returning to <handleHttpPostRequest> function.


Seems like no "editable" tools is associated with <ClientEdit> plugin in my project.
In 'demoEdit' project all is fine - <$shape> and <$tools> have some values.

I'm not a PHP programmer, so I can't debug this case to the end,
and I'm asking for Your help!

P.S. Platform: MacOSX 10.4.8, Mapserver 4.10.0, Cartoweb 3.3.0

Thanks!

Best regards, Igor.



More information about the Cartoweb-users mailing list