Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

GIS: GeoPoint inheritance

Go to End

5 Posts   1696 Views


Community Member, 23 Posts

12 October 2009 at 1:29pm

Edited: 12/10/2009 1:30pm

hi everybody!

I have a strange behaviour in datamodel and property inheritance, here's what I am trying to do.

class BaseClass extends DataObject {
	static $db = array(
		'Point' => 'GeoPoint',
		'Text' => 'Varchar'

class ChildClass extends BaseClass {
	public function getCMSFields(){
		print_r($this->Point); // empty
		print_r($this->Text); // it's ok, I see this property

It is simplified example of what I am trying to do. This code always return empty object. I have this object entry in db with right Point data, but it always return me object with no coordinates or any data that exist in db. any ideas?


Forum Moderator, 5523 Posts

12 October 2009 at 5:24pm

Try Debug::show($this->dbObject('Point')); and see if that returns you the GeoPoint object.


Community Member, 23 Posts

13 October 2009 at 12:41am

	public function getCMSFields() {	

Didn't found better place for it, anyway - it shows nothing...


Community Member, 23 Posts

13 October 2009 at 12:46am

main problem is not that simple I posted before, but I think it is a cause of this:

[User Error] GeoPoint::setValue() - Bad value '\000\000\000\000\000\000\000�����T@�����K@'


Forum Moderator, 801 Posts

16 October 2009 at 8:40am

Looks like a 2.3 specific bug, works fine in SilverStripe trunk - see this unit test:

The 2.3 bug is in DataObject->buildSQL(), where it uses databaseFields() instead of inheritedDatabaseFields(). The logic changed a bit in trunk, and I don't think its feasible to fix something so deep in the core for a late stage release branch. I'd suggest you patch your 2.3 installation for now, or wait for 2.4 :)