Hi, the latest -dev version of geofield / geophp returns this error when the coords are inserted:

"POINT (XXXX YYYY)" is not a valid geospatial content.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

FiNeX created an issue. See original summary.

plopesc’s picture

Hello

Could you try to give us some steps to reproduce the bug?

Thanks

FiNeX’s picture

Sure!

1) Install Drupal 8.1.1 + geophp-dev + geofield-dev
2) Create a "geofield" to a new content type or a block entity
3) Add a new entity of the created type/entity and fill the geofield with some data (I've used the following format for lat and lon: XX.XXXXX).
4) Save the content. This will return the error.

Thanks for your support!

plopesc’s picture

Status: Active » Postponed (maintainer needs more info)

Hello FiNeX

I tried using that environment and the module works for me. I saved a node with no problem.

You've to take into account some changes introduced in last -dev

GeoPHP module is no longer necessary
GeoPHP library has been moved to a composer dependency, so you've to run composer to download the library. Then it's placed automatically in the /vendor folder

Maybe your issue is coming from there.

Thanks

FiNeX’s picture

Hi, thanks for the info about the GeoPHP module and the composer dependency (it should be written on the module page and/or the README).

I've run composer install from the geofield directoy. It creates a "vendor" directory inside the module dir, so the GeoPHP lib is on the following path:

/modules/contrib/geofield/vendor/phayes/geophp

After doing that I've created a new geofield, but the error is the same as above:

"POINT (xx.xxxxxx yy.yyyyyy)" is not a valid geospatial content.

Maybe the GeoPHP path is wrong? Let me know if I can give you other info to debug this issue.

Thanks!

plopesc’s picture

Hello FINeX

The /vendor folder should not be generated in the module folder, it has to be generated in the project root.
You can check the documentation here: https://www.drupal.org/node/2404989

Depending on your project architecture you can follow an approach or another.

Hope this helps!

FiNeX’s picture

Hi Pablo,
I've also installed the geophp library on the /vendor folder in root using composer_manager. The path is "/vendor/phayes/geophp" but the error doesn't change. Do you have a suggestion how to debug?

Thanks!

FiNeX’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Hi, after updating to the latest version ( 8.x-1.0-alpha2 ) the bug is no more reproducible and everything works as expected.

mithesh.kavrani’s picture

Status: Closed (cannot reproduce) » Active

Hi,

The issue is still not fixed.
I executed the composer to download the library. It did update the vendor folder, but still not working.

Updated the module to 8.x-1.0-alpha2, but still its not working. And returns the same error.

Any help would be much appreciated.

Thanks

FiNeX’s picture

@mitesh: today I've experienced again the bug, after downloading the vendor I've restarted the apache webserver before rebuilding the registry. This procedure seems a way to bypass the problem.

stephen Piscura’s picture

Spent about ten hours on this today. Brain's fried, but still no solution.

I've successfully run composer install on the goefield module directory (creating a vendor folder there), but running composer install on my root Drupal 8 directory does nothing. Look like this:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

And the documentation isn't making it any clearer for me:

Drupal.org projects are not aggregated by the Packagist repository, which is the default repository of package meta data used by Composer. Therefore you will need to add Drupal.org as a Composer Repository to your composer.json file.

Drupal.org provides two separate composer repository endpoints: one for Drupal 7 and one for Drupal 8.
To use Composer with Drupal 7, use the repository url:
https://packages.drupal.org/7
To use Composer with Drupal 8, use the repository url:
https://packages.drupal.org/8

{
    "repositories": [
        {
            "type": "composer",
            "url":  "https://packages.drupal.org/8"
        }
    ]
}

https://www.drupal.org/node/2718229

Wait what? Does that apply here?

If someone could provide a step-by-step description of how to get this up and running, you'd be emancipating many from Drupal-growing-pains-hell.

Here's a long list of failure to drive the point and desperation home:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\geoPHP' not found in Drupal\geofield\GeoPHP\GeoPHPWrapper->load() (line 18 of modules/geofield/src/GeoPHP/GeoPHPWrapper.php).
Drupal\geofield\GeoPHP\GeoPHPWrapper->load('POINT (13.381815 52.516506)') (Line: 206)
Drupal\geofield\Plugin\Field\FieldType\GeofieldItem->populateComputedValues() (Line: 199)
Drupal\geofield\Plugin\Field\FieldType\GeofieldItem->setValue(Array, ) (Line: 69)
Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue(Array, 1) (Line: 118)
Drupal\Core\Field\FieldItemList->setValue(Array) (Line: 373)
Drupal\Core\Field\WidgetBase->extractFormValues(Object, Array, Object) (Line: 222)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object, Array, Object) (Line: 223)
Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity(Object, Array, Object) (Line: 291)
Drupal\Core\Entity\EntityForm->buildEntity(Array, Object) (Line: 74)
Drupal\Core\Entity\ContentEntityForm->buildEntity(Array, Object) (Line: 94)
Drupal\Core\Entity\ContentEntityForm->validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 83)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'node_reseller_form') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('node_reseller_form', Array, Object) (Line: 569)
Drupal\Core\Form\FormBuilder->processForm('node_reseller_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 112)
Drupal\node\Controller\NodeController->add(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\geoPHP' not found in Drupal\geofield\GeoPHP\GeoPHPWrapper->load() (line 18 of modules/geofield/src/GeoPHP/GeoPHPWrapper.php).
Drupal\geofield\GeoPHP\GeoPHPWrapper->load('POINT (13.381815 52.516506)', 'wkt') (Line: 53)
Drupal\geofield\Plugin\Validation\Constraint\GeoConstraint->validate('POINT (13.381815 52.516506)', Object) (Line: 185)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints('POINT (13.381815 52.516506)', '000000006998541d000000005ec612e7', Array) (Line: 140)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object) (Line: 147)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object) (Line: 147)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object) (Line: 147)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object, NULL, 1) (Line: 99)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object, NULL, NULL) (Line: 90)
Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object) (Line: 135)
Drupal\Core\TypedData\TypedData->validate() (Line: 373)
Drupal\Core\Entity\ContentEntityBase->validate() (Line: 96)
Drupal\Core\Entity\ContentEntityForm->validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 83)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 270)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'node_reseller_form') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('node_reseller_form', Array, Object) (Line: 569)
Drupal\Core\Form\FormBuilder->processForm('node_reseller_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 112)
Drupal\node\Controller\NodeController->add(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
"POINT (13.381815 52.516506)" is not a valid geospatial content.
stephen Piscura’s picture

Actually, the documentation for the Address module saved me. I'll paste in the documentation from the project page, modified for the needs of Geofield:

Installation

Address must be installed via Composer, in order to get the required libraries. The tarballs are provided for informative purposes only.

1. Add the Drupal Packagist repository

composer config repositories.drupal composer https://packagist.drupal-composer.org
This allows Composer to find Address and the other Drupal modules.

2. Download Address GeoPHP

composer require "drupal/address ~8.1"
composer require "phayes/geophp"
This will download the latest release of Address GeoPHP.

Following this recipe, i was able to save the node with Geofield data. On to the next step...

Jej’s picture

Thank you Stephen Piscura #12 :)

J.

AndyLicht’s picture

Hi,
i´m getting the error "POINT (34.0 45.0)" is not a valid geospatial content, too.
So, i have installed:
drupal 8.1.2
geofield 8.x-1.0-alpha2 (2016-May-25) from zip source.

i have no more other modules installed.

I`m testing with postgresql 9.5, php 7.0.2 on windows 10 with xampp.

I really do not need geoPHP?
thanks for helping me.
best regards
Andy

scott.whittaker’s picture

I had the same issue with "POINT (XXX YYY)" is not a valid geospatial content message whenever I try to save too. Using brand new Drupal 8 stable release, current alpha of Geofield and not much else.

Tried composer install from the module which built the vendor folder under the module. Manually moved the vendor folder contents to /vendor, and eventually ran the manual composer require mentioned in #12. That took about 20 minutes to complete, but managed to save after that.

Unfortunately I can't display the point on a leaflet map, it generates a 500 error: "PHP message: PHP Fatal error: Call to undefined function geophp_load() in leaflet.module on line 135". Not sure yet whether leaflet or geofield is to blame.

hizard’s picture

@ stephen Piscura
Thank you for provide us this information, i can save the form containing a geofield now.

So to resume under GNU/Linux go to the root of your Drupal 8 website and write in the console:
composer config repositories.drupal composer https://packagist.drupal-composer.org
(This allows Composer to find Address and the other Drupal modules.)
and finaly download GeoPHP with composer:
composer require "phayes/geophp"

FiNeX’s picture

Warning: Drupal Packagist is deprecated, the official alpha Composer endpoint for Drupal 8 is: https://packages.drupal.org/8 (more info on https://www.drupal.org/node/2718229).

MattClark’s picture

Re: #13 @scott.whittaker, I had the same issue. Line 135 of leaflet.module calls a function geophp_load(). There is no such function defined by the current version of the GeoPHP library that Composer installs (1.2 at this time). There is a load method on the geoPHP class, however. Changing line 135 to geoPHP::load(); worked for me. But calling geoPHP::load() with no arguments seems to be superfluous. Omitting it also seems to work, but I haven't tested very thoroughly.

tobiasb’s picture

Status: Active » Needs review
FileSize
425 bytes

Updated patch. Because the other patch renames the file leaflet.module to leaflet.module.new ;-)

gstout’s picture

Same, can't save bug.
"POINT (-115.431841 36.411817)" is not a valid geospatial content.

I've got composer-manager telling me I've got the lib installed correctly

phayes/geophp
GeoPHP is a open-source native PHP library for doing geometry operations. It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: WKT (including EWKT), WKB (including EWKB), GeoJSON, KML, GPX, GeoRSS). It works with all Simple-Feature geometries (Point, LineString, Polygon, GeometryCollection etc.) and can be used to get centroids, bounding-boxes, area, and a wide variety of other useful information.
dev-master#685562416ec6d22b9b3927e02ca0ddacf84ca646	dev-master
Required by: Geofield

I tried 8.x-1.x-dev and 8.x-1.0-alpha2

nether works

I see this is the logs and it looks like the Geofield just can't connect to the geophp lib

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\geoPHP' not found in Drupal\geofield\GeoPHP\GeoPHPWrapper->load() (line 18 of /srv/bindings/4943bfdeebaf46c4989aecce775b6b20/code/modules/geofield/src/GeoPHP/GeoPHPWrapper.php).

---

I even , now a day later I went and tried to rebuild a working version of 8.x-1.0-alpha1 that still used geophp but there were so many bugs and patches that needed to be coordinated that it I could only get it to save and never display.

I feel like the alpha2 to is a few bug fixes away from greatness but as it is, its unusable. This is a big loss for drupal 8 since it seems like a cornerstone of all the mapping goodness out there.

I'm happy to help test if there is a fix

gstout’s picture

Version: 8.x-1.x-dev » 8.x-1.0-alpha2
Priority: Normal » Major
tobiasb’s picture

@gstout Did you read the part

Drupal 8 and GeoPHP library dependency
Since 8.x-1.0-alpha2 version, this module is not depending on GeoPHP module anymore. The GeoPHP library dependency is being managed through composer. Please read https://www.drupal.org/node/2718229 for more information about composer dependencies.

Without a proper composer setup, it can not found the external lib. ;-)

gstout’s picture

@ tobiasb Yes, read that, installed libraries, confirmed they were in with composer-manager[see below]

phayes/geophp
GeoPHP is a open-source native PHP library for doing geometry operations. It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: WKT (including EWKT), WKB (including EWKB), GeoJSON, KML, GPX, GeoRSS). It works with all Simple-Feature geometries (Point, LineString, Polygon, GeometryCollection etc.) and can be used to get centroids, bounding-boxes, area, and a wide variety of other useful information.
dev-master#685562416ec6d22b9b3927e02ca0ddacf84ca646	
dev-master
Required by: Geofield

(not sure is there is another magical way to confirm composer is working as it should. The composer documentation is a disaster.)

None of that worked. Desperate, I then went even further and tried to rebuild a working version of 8.x-1.0-alpha1 that still used geophp but there were so many bugs and patches that needed to be coordinated that it I could only get it to save and never display.

tobiasb’s picture

Status: Needs review » Needs work
gstout’s picture

@tobiasb Thanks for the clean up.

We need to keep this issue focused on the fact that a default install of alpha2 with verified composer install of phayes/geophp dev-master#685562416ec6d22b9b3927e02ca0ddacf84ca646 or tag 1.2 (tried both) will not store a lat and long.

As i said before

I feel like the alpha2 to is a few bug fixes away from greatness but as it is, its unusable. This is a big loss for drupal 8 since it seems like a cornerstone of all the mapping goodness out there.

I'm happy to help test if there is a fix

qpro’s picture

Same error testing in: Drupal 8.2.1 , geophp dev-master#685562416ec6d22b9b3927e02ca0ddacf84ca646 and geofield 8.x-1.0-alpha2

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\geoPHP' not found in Drupal\geofield\GeoPHP\GeoPHPWrapper->load() (line 18 of /var/www/test/modules/geofield/src/GeoPHP/GeoPHPWrapper.php)

I'm also happy to help test

gdelver@xs4all.nl’s picture

@qpro, i have the following stack working on d8.2.1 ... the next code is the command line code in a .sh file

#!/bin/bash
# file: d8geofield.sh
# execute $ sh d8geofield.sh
ECHO “CONFIGURING REPOSITORIES”
composer config repositories.drupal composer https://packages.drupal.org/8
ECHO “REQUIRING TOOLBAR MODULES”
composer require drupal/admin_toolbar 1.17
ECHO “GENERAL MODULES”
composer require drupal/token 1.0-beta1
ECHO “REQUIRING GEO STACK MODULES”
composer require drupal/geofield 1.0-alpha2
composer require drupal/geocoder 2.0-alpha4
composer require drupal/geocoder_autocomplete 1.0-alpha1
composer require drupal/address 1.0-rc1
composer require drupal/styled_google_map 2.0-alpha1

Works fine for me. Done on a fresh install of D8.2.1. Tested and does a nice map display out of a geocoded address into the geofield.
Good luck, Guido

Clemence.Blazy’s picture

I got the same problem and manage to find a solution that worked for me. It took me quite a while so here are my steps:

Composer is already installed with drupal 8.

1-Go to your computer's console (or Terminal for Mac).
2-Go to your drupal file directory (for newbies like me, on MAC paste: cd Applications/MAMP/htdocs/(name of your drupal installation))
3-Then paste: composer config repositories.drupal composer https://packages.drupal.org/8
4-Then paste : composer require "phayes/geophp"
5-Then wait till you see downloading 100%

I now manage to save GPS codes.
I still have some difficulties with leaflet, but that's another story.

adriancid’s picture

#28 works for me

Carlos Miranda Levy’s picture

Neither 27 or 28 worked for me.
With 27 creation of address field leads to a white screen on second page of the creation process
With 28, composer says it can't installed geophp because geofield already di.

nottaken’s picture

#28 worked for me.

pawel_r’s picture

None solution had worked for me [Drupal 8.2.4]

qpro’s picture

Thanks @gdelver@xs4all.nl

After updating something (not sure what) it works for me, my actual config:

- Drupal core 8.2.3

modules
- Geocoder 8.x-2.0-alpha4
- Geolocation Field 8.x-1.8
- Leaflet 8.x-1.0-beta1

package depedencies
- phayes/geophp dev-master#685562416ec6d22b9b3927e02ca0ddacf84ca646
- leaflet/leaflet v0.7.7

Jej’s picture

Each time I update Drupal I have to apply again #12 / #28 solution. It works well, but just have to remember to do that.

I don't understand why this problem persists for so long time!... Anyway, thanks for people helping.

frozen10’s picture

Steps to get this working

1. Download Styled Google Map module as normal
2. Download geofield module as normal
3. Go to your project/drupal root
4. If needed run first in your project root
composer config repositories.drupal composer

5. Then from project root run:
composer require "phayes/geophp"
Once it's done downloading it should appear in your project root /vendor/phayes folder.

6. Make sure your Styled Google Maps Module and Geofield module are enabled
7. Add your field to your custom block or content type
8. You should be all good.

chee123’s picture

Map issue

mano2003’s picture

#28 worked for me.

lauramunro’s picture

Using Drupal 8.3.7 I installed Geofield 8.x-1.0-alpha4 using composer, added a geofield to a content type, and when I tried to enter data I got this error - "POINT (XXXX YYYY)" is not a valid geospatial content.

After that I had to run "composer require drupal/geofield --prefer-dist" (from comment #28) to install the library to the /vendors folder. Once the geophp library was installed I was able to save data in the geofield with no problems. Even geofield_map 8.x-1.9 is working with it so far. Great job on these modules!

matsbla’s picture

Maybe there should be some more documentation in the module readme file? Its only says "Install the modules Geofield and geoPHP in the usual way." - What is the usual way? I got help from #28 & #38, but I think this could be documented better.

Anonymous’s picture

I can only install modules and configure them through the web admin interface. Is there a way to solve the dependencies on geophp without running composer? I get these "POINT (116.391043 39.912145)" is not a valid geospatial content error messages. I know it can be solved with composer, but i hope there is another way.

batigolix’s picture

Component: Code » Documentation
john_morris’s picture

Good day folks. I too am getting the error "POINT (XXXX YYYY)" is not a valid geospatial content.
Have spent hours applying the fixes here for my 8.4.2 instance and for the life of me I cannot get this to work. Has any straight forward "single location" documentation been created to get GeoField up and running?
Thanks for any enlightenment,
John

itamair’s picture

Composer should be used to install the GeoPhp dependency of Geofield: Using Composer to manage Drupal site dependencies,
As a tmp solution (and not stable), if you really cannot get rid of Composer procedure, try to manually copy the geoPHP library into your "vendor" folder.
Download it from here: https://github.com/phayes/geoPHP/archive/master.zip, name the folder into "geoPHP" and move it into a "phayes" so that will be (from your project root): vendor/phayes/geoPHP

john_morris’s picture

itamair, I was already one step ahead of your suggestion and I manually loaded geoPHP and the error does still persist. I used composer first per the guidelines outlined in this bug report, but none of the suggestions above seem to function. Using composer also presented it's own issues as double vendor folders were created, making it somewhat confusing as to which is needed or not. Hmmm, scratching head here. Thanks for your reply itamair, it's greatly appreciated.

ds1964’s picture

Following. Also unable to solve using composer or #43.

vunda’s picture

anybody got it to work

itamair’s picture

Ok ... after inspecting some more it is clear that the workaround (tmp solution) suggested in the #43 won't work (sorry for that)
as the classes autoload mechanism is managed by composer autoload files, if the geoPHP library is requested by composer.json in the module, as indeed it is in the last (and actual) release of the Geofield module.
Everybody can get more on this from this detailed article: Composer autoloading and Drupal 8

It comes out that the proper (and unique) way to make Geofield module properly working is running the following command (at your composer.json file path):

Eventually (if not already set into your composer.json):

$ composer config repositories.drupal composer https://packages.drupal.org/8

Mandatory:

$ composer require drupal/geofield

Note: as eventual ex-post fix (un-needed if everything goes well) you can force the download of the geoPHP library with:

$ composer require "phayes/geophp:dev-master"

So (IMHO) it means that if you are experiencing this "Latitude and Longitude are not accepted" issue it might only mean the following:

  • you are not correctly adding the module in this way;
  • your composer command is not properly finalizing;
  • your dev environment is not working properly with composer;

And that's it!

itamair’s picture

Status: Needs work » Closed (works as designed)
Maffoo’s picture

In case it helps anyone googling this, my issue was that my local site was running PHP 7.1 and the live site was running PHP 7.0. So I had installed a PHP 7.1 compatible version of this module and its dependencies, but really it needed an older version. Fixed by adding a specific dependency to my composer.json:

{
  "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8",
        "platform": {
            "php": "7.0.31"
        }
    },
    ...
}
itamair’s picture

Last but not least ... and besides all the previous best working tips (#28, #47)

please make also sure you disable and remove any instance of Drupal Geophp module possibly existing in your environment ... that would otherwise badly interfere with the vendor/phayes/geophp library/class autoloading

itamair’s picture

Status: Closed (works as designed) » Needs review
tormi’s picture

Status: Needs review » Active

Needs review is for reviewing patches which there are none.

itamair’s picture

Status: Active » Closed (works as designed)
nick0989’s picture

Number 28 worked for me.

itamair’s picture

Title: Latitude and Longitude are not accepted » Latitude and Longitude are not accepted (composer approach needed)
ryanbuckley@gmail.com’s picture

I've worked my way through this thread and have tried all of the above approaches, but I end up most recently with the following error:

# composer require "phayes/geophp:dev-master"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/geofield 1.8.0 requires phayes/geophp ^1.2 -> satisfiable by phayes/geophp[1.2] but these conflict with your requirements or minimum-stability.
- drupal/geofield 1.8.0 requires phayes/geophp ^1.2 -> satisfiable by phayes/geophp[1.2] but these conflict with your requirements or minimum-stability.
- drupal/geofield 1.8.0 requires phayes/geophp ^1.2 -> satisfiable by phayes/geophp[1.2] but these conflict with your requirements or minimum-stability.
- Installation request for drupal/geofield ^1.8 -> satisfiable by drupal/geofield[1.8.0].

Installation failed, reverting ./composer.json to its original content.

EDIT: I do have the geoPHP module installed. The error I'm still getting is:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\geoPHP' not found in Drupal\geofield\GeoPHP\GeoPHPWrapper->load() (line 21 of /home/magnumco/public_html/d8/modules/geofield/src/GeoPHP/GeoPHPWrapper.php)

ryanbuckley@gmail.com’s picture

Any suggestions?

ryanbuckley@gmail.com’s picture

Is it possible to install this without Composer? Our site wasn't set-up using composer, and from what I can tell, that leads to other issues when trying to use composer later. Is there a way to install using Ludwig? We did this for the Address form, as an alternative to composer.

Thanks.

itamair’s picture

Sorry to say, but the only really issues arise not using composer for managing Drupal 8 projects, as you can see, instead.
D8 projects need Composer, that's it. All the other workarounds ... well, are just not solid workarounds.

How many times should we still underline this?

There are no downsides to convert into Composer management, after a first no-Composer approach.
It is just a matter to learn (how to install and use) Composer ... and re-map all the modules that you have added so far into your project,
and "require"them with Composer.
That's it ...

There aren't great shortcuts for Drupal 8 and its advanced functionalities. It's just a matter to get the proper skills, or sponsor someone with those.

Otherwise (IMO) better to rely on D7, or Wordpress ... etc.