upon saving a node with the cck map field, i get SQL error as below (my cck field name is 'location'). seems like author is aware since the expand function has a 'not quite done yet' comment. would be sweet to find time for this.

user warning: Column 'field_location' cannot be null query: geo_backend_field INSERT INTO content_field_location (field_location, vid, nid) VALUES (GeomFromText('', 4326), 26, 25) in /Users/mw/htd/dr5/includes/database.mysqli.inc on line 151.

CommentFileSizeAuthor
#3 geo_two_points.patch3.33 KBgreggles

Comments

bdragon’s picture

Yeah, I've been testing in WKT mode, the map stuff is kinda half baked at the moment.

I have plans for implementing it in a robust way using openlayers, but need a couple boxes of tuits.

greggles’s picture

If I enter in any text I get the error message "Unable to parse WKT."

If I leave the field blank then I get a message similar to Moshe's.

If I enter in WKT for the data type I'm using then it seems to work fine.

@bdragon - would you accept a patch that provides better help text for this such as some appropriate WKT guidance.

e.g. the point entry would say "Enter your point in the format POINT(6 10)"

If the module had that then I think it would be "good enough" to maybe get a development release. Maybe? Please?

greggles’s picture

Title: cck field will not save data » make it easier to use input fields
Status: Active » Needs review
StatusFileSize
new3.33 KB

Attached patch provides an additional widget for point fields - the two text box widget.

It does seem weird stuff with the "process form values" op of hook_widget to get the data into the format that is expected. I'm not sure if that's how you want to get this to work or not, but it seemed to work in my testing.

While this doesn't directly solve Moshe's issue, I feel like the underling issue that you had, Moshe, was not knowing what to put into the box, right?

bdragon’s picture

Status: Needs review » Active

Committed a modified version of the patch in http://drupal.org/cvs?commit=87370.

Thoughts?

greggles’s picture

With my critical hat on:

The function name _geo_latlonfrompoint seems odd (most functions seem to separate words with _) and your version involved queries where mine just parsed stuff (which I guess is why you said // Yep. Not efficient.) Yours is slower for the benefit of being more reliable (right?).

With my happy hat on:

Who cares! Yay progress!

Did you move this back to active to get more ideas on the subject of making input simpler? And/or to throw a more graceful error for the case that no data is entered?

bdragon’s picture

Yeah, the function name needs work. Mine involves queries because yeah, I'd like the database to be the one to give the go-ahead, as it knows what it will accept. If we do our own WKT parsing, I'd want it to be proper parsing of Simple Features. Until then I'll just rely on the database to do translation.

The simplest input would be using OpenLayers to provide the WKT. (It has a native reader/writer.) I haven't had time to work on the OpenLayers integration yet though. It's on my list.

allie micka’s picture

Status: Active » Closed (won't fix)

I'm going to "won't fix" this, mostly because the described behavior has been replaced, and is functioning in new and differently-broken ways ;) Please open specific issues if you've got 'em.