markaspot / mark-a-spot

Public Civic Issue Tracking and Crowdsourcing / Mapping Platform based on Drupal. Open311 Server and Client Software
http://mark-a-spot.com
55 stars 30 forks source link

markaspot_validation module crashes attempt to change default location for node.service.request.field_geolocation #48

Closed carlosmirandalevy closed 7 years ago

carlosmirandalevy commented 7 years ago

Attempting to change the default geolocation value for node.service_request.field_geolocation (in admin/structure/types/manage/service_request/fields/node.service_request.field_geolocation) returns an error from markaspot_validation.

I tried clearing (erasing) the Polygon in WKT formati in markaspot_validation settings, but still got the same error when trying to change the default value for geolocation field.

Uninstalling the markaspot_validation module fixes the problem.

The onscreen geolocation part works fine, addresses are found and displayed on map, but when saving the change, the following error is generated on log:

Error: Class 'GeoPHP\Geo' not found in Drupal\markaspot_validation\Plugin\Validation\Constraint\ValidLatLonConstraintValidator::polygonCheck() (line 67 of /var/www/vhosts/mark-a-spot/web/modules/contrib/markaspot_validation/src/Plugin/Validation/Constraint/ValidLatLonConstraintValidator.php) #0 /var/www/vhosts/mark-a-spot/web/modules/contrib/markaspot_validation/src/Plugin/Validation/Constraint/ValidLatLonConstraintValidator.php(26): Drupal\markaspot_validation\Plugin\Validation\Constraint\ValidLatLonConstraintValidator::polygonCheck(2.2693392, 48.8500252) #1 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(185): Drupal\markaspot_validation\Plugin\Validation\Constraint\ValidLatLonConstraintValidator->validate(Object(Drupal\Core\Field\FieldItemList), Object(Drupal\markaspot_validation\Plugin\Validation\Constraint\ValidLatLonConstraint)) #2 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(140): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints(Object(Drupal\Core\Field\FieldItemList), '0000000079dad94...', Array) #3 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(99): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object(Drupal\Core\Field\FieldItemList), Array, true) #4 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php(90): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object(Drupal\Core\Field\FieldItemList), NULL, NULL) #5 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/TypedData/TypedData.php(135): Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object(Drupal\Core\Field\FieldItemList)) #6 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Field/FieldItemList.php(318): Drupal\Core\TypedData\TypedData->validate() #7 /var/www/vhosts/mark-a-spot/web/core/modules/field_ui/src/Form/FieldConfigEditForm.php(153): Drupal\Core\Field\FieldItemList->defaultValuesFormValidate(Array, Array, Object(Drupal\Core\Form\FormState)) #8 [internal function]: Drupal\field_ui\Form\FieldConfigEditForm->validateForm(Array, Object(Drupal\Core\Form\FormState)) #9 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Form/FormValidator.php(83): call_user_func_array(Array, Array) #10 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Form/FormValidator.php(270): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState)) #11 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Form/FormValidator.php(119): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'field_config_ed...') #12 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Form/FormBuilder.php(571): Drupal\Core\Form\FormValidator->validateForm('field_config_ed...', Array, Object(Drupal\Core\Form\FormState)) #13 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('field_config_ed...', Array, Object(Drupal\Core\Form\FormState)) #14 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('field_config_ed...', Object(Drupal\Core\Form\FormState)) #15 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #16 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #17 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #18 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #19 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #20 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #21 /var/www/vhosts/mark-a-spot/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) #22 /var/www/vhosts/mark-a-spot/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #23 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /var/www/vhosts/mark-a-spot/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /var/www/vhosts/mark-a-spot/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /var/www/vhosts/mark-a-spot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /var/www/vhosts/mark-a-spot/web/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /var/www/vhosts/mark-a-spot/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #32 {main}.

markaspot commented 7 years ago

Did you update to the latest commit of markaspot_validation? What is the repo-url for phayes/geophp. Please check the composer.lock file for that. Thank you!

carlosmirandalevy commented 7 years ago

I did.

ls -l
-rwxr-xr-x  1 xxx xxx  12522 Mar  9 12:32 composer.json
-rw-r--r--  1 xxx xxx 313030 Mar 11 17:12 composer.lock

From composer.lock:

            "require": {
                "anthonymartin/geo-location": "^1.0",
                "phayes/geophp": "dev-master",
                "weiyongsheng/polygon": "dev-master"
            },
            "type": "drupal-module",
            "notification-url": "https://packagist.org/downloads/",
            "authors": [
                {
                    "name": "Holger Kreis (markaspot)",
                    "homepage": "https://www.drupal.org/u/markaspot",
                    "role": "Maintainer"
                }
            ],
            "description": "Provides some constraints for entities of the Mark-a-Spot ditribution.",
            "homepage": "https://github.com/markaspot/markaspot_validation",
            "time": "2017-02-21 03:30:20"
        },
markaspot commented 7 years ago

Please check and run composer update again. Composer.json of the validation module must refer to

 "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/mishal/GeoPHP"
    }
  ],
  "require": {
    "phayes/geophp": "dev-master",
    "weiyongsheng/polygon": "dev-master",
    "anthonymartin/geo-location": "^1.0"
  }
markaspot commented 7 years ago

I close this issue, please reopen if this still occurs.