diff --git a/lizmap/modules/dataviz/classes/datavizPlot.class.php b/lizmap/modules/dataviz/classes/datavizPlot.class.php index b7ce1147b1..b43e2ed974 100644 --- a/lizmap/modules/dataviz/classes/datavizPlot.class.php +++ b/lizmap/modules/dataviz/classes/datavizPlot.class.php @@ -7,7 +7,6 @@ * * @license Mozilla Public License */ - class datavizPlot { /** diff --git a/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php b/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php index 3651f018d4..277919f0a5 100644 --- a/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php +++ b/lizmap/modules/lizmap/classes/qgisVectorLayer.class.php @@ -9,9 +9,6 @@ * * @license Mozilla Public License : http://www.mozilla.org/MPL/ */ - -use GuzzleHttp\Psr7; - class qgisVectorLayer extends qgisMapLayer { // layer type @@ -1117,7 +1114,7 @@ public function isFeatureEditable($feature) 'PROPERTYNAME' => implode(',', $properties), 'OUTPUTFORMAT' => 'GeoJSON', 'GEOMETRYNAME' => 'none', - 'EXP_FILTER' => implode(' AND ', $exp_filters) + 'EXP_FILTER' => implode(' AND ', $exp_filters), ); // Perform the request to get the editable features @@ -1137,29 +1134,29 @@ public function isFeatureEditable($feature) } $featureStream = \Psr7\StreamWrapper::getResource($result->getBodyAsStream()); - $features = \JsonMachine\Items::fromStream($featureStream, ['pointer' => "/features"]); + $features = \JsonMachine\Items::fromStream($featureStream, array('pointer' => '/features')); if (iterator_count($features) !== 1) { return false; } return true; -/* - // Get data - $wfsData = $result->getBodyAsString(); + /* + // Get data + $wfsData = $result->getBodyAsString(); - // Check data: if there is no data returned by WFS, the user has not access to it - if (!$wfsData) { - return true; - } + // Check data: if there is no data returned by WFS, the user has not access to it + if (!$wfsData) { + return true; + } - // Get data from layer - $wfsData = json_decode($wfsData); - if (count($wfsData->features) !== 1) { - return false; - } + // Get data from layer + $wfsData = json_decode($wfsData); + if (count($wfsData->features) !== 1) { + return false; + } - return true; - */ + return true; + */ } /** diff --git a/lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php b/lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php index bb30a62908..ad5fa9d196 100644 --- a/lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php +++ b/lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php @@ -106,18 +106,18 @@ public function getData($form) // Process request $wfsResult = $wfsRequest->process(); - //$data = $wfsResult->getBodyAsString(); + // $data = $wfsResult->getBodyAsString(); $mime = $wfsResult->getMime(); - if ($data && (strpos($mime, 'text/json') === 0 - || strpos($mime, 'application/json') === 0 - || strpos($mime, 'application/vnd.geo+json') === 0)) { + if (strpos($mime, 'text/json') === 0 + || strpos($mime, 'application/json') === 0 + || strpos($mime, 'application/vnd.geo+json') === 0) { /*$json = json_decode($data); // Get result from json $features = $json->features;*/ $featureStream = \Psr7\StreamWrapper::getResource($wfsResult->getBodyAsStream()); - $features = \JsonMachine\Items::fromStream($featureStream, ['pointer' => "/features"]); + $features = \JsonMachine\Items::fromStream($featureStream, array('pointer' => '/features')); foreach ($features as $feat) { if (property_exists($feat, 'properties') and property_exists($feat->properties, $keyColumn)