Closed (works as designed)
Project:
Geofield
Version:
8.x-1.0-alpha2
Component:
Documentation
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 May 2016 at 17:53 UTC
Updated:
2 Apr 2020 at 18:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
plopescHello
Could you try to give us some steps to reproduce the bug?
Thanks
Comment #3
finex commentedSure!
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!
Comment #4
plopescHello 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
Comment #5
finex commentedHi, 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 installfrom 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/geophpAfter 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!
Comment #6
plopescHello 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!
Comment #7
finex commentedHi 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!
Comment #8
finex commentedHi, after updating to the latest version ( 8.x-1.0-alpha2 ) the bug is no more reproducible and everything works as expected.
Comment #9
mithesh.kavrani commentedHi,
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
Comment #10
finex commented@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.
Comment #11
stephen Piscura commentedSpent about ten hours on this today. Brain's fried, but still no solution.
I've successfully run
composer installon the goefield module directory (creating a vendor folder there), but runningcomposer installon my root Drupal 8 directory does nothing. Look like this:And the documentation isn't making it any clearer for me:
—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:
Comment #12
stephen Piscura commentedActually, the documentation for the Address module saved me. I'll paste in the documentation from the project page, modified for the needs of Geofield:
Following this recipe, i was able to save the node with Geofield data. On to the next step...
Comment #13
Jej commentedThank you Stephen Piscura #12 :)
J.
Comment #14
AndyLicht commentedHi,
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
Comment #15
scott.whittaker commentedI 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.
Comment #16
hizard commented@ 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"Comment #17
finex commentedWarning: 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).
Comment #18
MattClark commentedRe: #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 aloadmethod on the geoPHP class, however. Changing line 135 togeoPHP::load();worked for me. But callinggeoPHP::load()with no arguments seems to be superfluous. Omitting it also seems to work, but I haven't tested very thoroughly.Comment #19
tobiasbUpdated patch. Because the other patch renames the file leaflet.module to leaflet.module.new ;-)
Comment #20
gstout commentedSame, 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
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
Comment #21
gstout commentedComment #22
tobiasb@gstout Did you read the part
Without a proper composer setup, it can not found the external lib. ;-)
Comment #23
gstout commented@ tobiasb Yes, read that, installed libraries, confirmed they were in with composer-manager[see below]
(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.
Comment #24
tobiasbThe patch was for leaflet. Then I found #2731917: New version of geofield uses composer for the geophp dependency, call to geophp_load() in leaflet_process_geofield() not needed. (composer + leaflet)
Comment #25
gstout commented@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
Comment #26
qproSame 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
Comment #27
gdelver@xs4all.nl commented@qpro, i have the following stack working on d8.2.1 ... the next code is the command line code in a .sh file
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
Comment #28
Clemence.Blazy commentedI 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.
Comment #29
adriancid#28 works for me
Comment #30
Carlos Miranda Levy commentedNeither 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.
Comment #31
nottaken commented#28 worked for me.
Comment #32
pawel_r commentedNone solution had worked for me [Drupal 8.2.4]
Comment #33
qproThanks @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
Comment #34
Jej commentedEach 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.
Comment #35
frozen10 commentedSteps 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.
Comment #36
chee123 commentedMap issue
Comment #37
mano2003 commented#28 worked for me.
Comment #38
lauramunro commentedUsing 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!
Comment #39
matsbla commentedMaybe 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.
Comment #40
Anonymous (not verified) commentedI 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.
Comment #41
batigolixComment #42
john_morris commentedGood 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
Comment #43
itamair commentedComposer 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
Comment #44
john_morris commenteditamair, 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.
Comment #45
ds1964 commentedFollowing. Also unable to solve using composer or #43.
Comment #46
vunda commentedanybody got it to work
Comment #47
itamair commentedOk ... 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/8Mandatory:
$ composer require drupal/geofieldNote: 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:
And that's it!
Comment #48
itamair commentedComment #49
Anonymous (not verified) commentedIn 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:
Comment #50
itamair commentedLast 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
Comment #51
itamair commentedComment #52
tormiNeeds review is for reviewing patches which there are none.
Comment #53
itamair commentedComment #54
nick0989 commentedNumber 28 worked for me.
Comment #55
itamair commentedComment #56
ryanbuckley@gmail.com commentedI'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)
Comment #57
ryanbuckley@gmail.com commentedAny suggestions?
Comment #58
ryanbuckley@gmail.com commentedIs 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.
Comment #59
itamair commentedSorry 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.