Skip to content

Commit

Permalink
IPreviewableFieldType \ Fixed MapModel bug
Browse files Browse the repository at this point in the history
- FieldType now implements IPreviewableFieldType
- Fixed a bug in the SimpleMap_MapModel where __toString() wouldn’t return a string if no address was available.
  • Loading branch information
Tam committed Sep 6, 2017
1 parent a4fdf5c commit 1930e50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion simplemap/fieldtypes/SimpleMap_MapFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Craft;

class SimpleMap_MapFieldType extends BaseFieldType {
class SimpleMap_MapFieldType extends BaseFieldType implements IPreviewableFieldType {

public function getName()
{
Expand Down
2 changes: 1 addition & 1 deletion simplemap/models/SimpleMap_MapModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SimpleMap_MapModel extends BaseModel {

public function __toString ()
{
return $this->address;
return $this->address ?: "";
}

protected function defineAttributes()
Expand Down

0 comments on commit 1930e50

Please sign in to comment.