Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25246

ezplatform-solr-search-engine // gmaplocation content creation issues with german locale

    XMLWordPrintable

    Details

      Description

      Using a different locale (such as de_DE) will cause content publishing to fail, if this content includes a gmap location value.

      STEPS TO REPRODUCE

      • setup an eZPublish 5.4.5 environment, with ezplatform-solr-search-engine bundled.
      • create a custom class (test_class), including a text field and a gmap location field
      • setup a command as follows:
      class ExampleCommand extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand {
       
        /**
         * Configures the command
         */
        protected function configure() {
          $this->setName('ezpublish:cookbook:example');
        }
       
        /**
         * Executes the command
         * @param InputInterface $input
         * @param OutputInterface $output
         */
        protected function execute(InputInterface $input, OutputInterface $output) {
          setlocale(LC_ALL, 'de_DE.UTF-8');
          
          $repository = $this->getContainer()->get('ezpublish.api.repository');
       
          $repository->setCurrentUser($repository->getUserService()->loadUser(14));
       
          $contentService = $repository->getContentService();
          $locationService = $repository->getLocationService();
          $contentTypeService = $repository->getContentTypeService();
       
          $contentType = $contentTypeService->loadContentTypeByIdentifier('test_class');
          $contentCreateStruct = $contentService->newContentCreateStruct($contentType, 'eng-GB');
       
          $contentCreateStruct->setField('title', 'Test Content');
          $contentCreateStruct->setField('location', new MapLocationValue(array('latitude' => 41.824882,'longitude' => -8.280432,'address' => 'io')));
       
          $locationCreateStruct = $locationService->newLocationCreateStruct(2);
          $draft = $contentService->createContent($contentCreateStruct, array($locationCreateStruct));
          $content = $contentService->publishVersion($draft->versionInfo);
        }
      }
      
      • execute the command
      • Expected result => Content is published
      • Actual result => Operation fails with an exception.
       [RuntimeException]                                                                                                                                                                                                                          
        Wrong HTTP status received from Solr: 400array (                                                                                                                                                                                            
          0 =>                                                                                                                                                                                                                                      
          EzSystems\EzPlatformSolrSearchEngine\Gateway\Message::__set_state(array(                                                                                                                                                                  
             'headers' =>                                                                                                                                                                                                                           
            array (                                                                                                                                                                                                                                 
              'version' => '1.1',                                                                                                                                                                                                                   
              'status' => 400,                                                                                                                                                                                                                      
              'Content-Type' => 'text/plain;charset=UTF-8',                                                                                                                                                                                         
            ),                                                                                                                                                                                                                                      
             'body' => '{"responseHeader":{"status":400,"QTime":0},"error":{"msg":"Can\'t parse point \'41,824882,-8,280432\' because: java.lang.NumberFormatException: For input string: \\"824882,-8,280432\\"","c  
        ode":400}}                                                                                                                                                                                                    
         ',                                                                                                                                                                                                                                          
          )),                                                                                                                                                                                                                                       
      
      • In solr log, the following is echoed

        ERROR org.apache.solr.core.SolrCore – org.apache.solr.common.SolrException: Can't parse point '41,824882,-8,280432' because: java.lang.NumberFormatException: For input string: "824882,-8,280432"

        NOTE
        if we comment the setLocale or setField('location' lines, the content is published without constraints

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                joaquim.cavalleri-obsolete@ez.no Joaquim Cavalleri (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: