symbiote / silverstripe-addressable Goto Github PK
View Code? Open in Web Editor NEWAdds configurable address fields to an object, and provides automatic geocoding.
License: BSD 3-Clause "New" or "Revised" License
Adds configurable address fields to an object, and provides automatic geocoding.
License: BSD 3-Clause "New" or "Revised" License
I'm recently new to Silverstripe and Silverstripe modules and i can't get this module working on V3 of silverstripe.
I created a folder called 'addressable' in the root of my website/silverstripe intallation and uploaded all the files (code, templates, _config etc.) to this folder. After that i ran /dev/build, and added these lines to my 'mysite/_config.php' file:
Object::add_extension('Winkel', 'Addressable');
Object::add_extension('Winkel', 'Geocodable');
And rebuild the site again. After that i went to the page 'Winkel' in Silverstripe and got a 'Internal server error'. Anything i'm missing?
Thanks in advance!
I can't override the Address template. I noticed because it interferes with the silvershop admin interface (the field names are different so the address does not show)
I've tried putting overrides in themes, mysite and themename_addressable - nothing overrides it.
when i delete addressable's Address.ss file, the expected hierarchy of templates works again.
It's been some time since there has been a tagged release as it's been so long and there have been quite a few enhancements/updates.
Is anyone working on SS4 support and could give some timelines? Or provide a cost to get it upgraded, I have a motivated client.
Love this module and have used it a lot in my 2.4 projects. I have just installed it on a SS3 project and notice that you have removed the functionality to manually set the marker and lat and lon. Any reason as this was a function i used a lot as most of the locations i use it for don't have full addresses or postcodes?
Regards
Mick
This code starting on line 46 in GoogleGeocodeService.php:
$key = getenv('GOOGLE_API_KEY') ?? Config::inst()->get(__CLASS__, 'google_api_key') ?? Config::inst()->get('Symbiote\\Addressable\\GeocodeService', 'google_api_key');
does not work I believe. getenv() always returns either a string or false. Using the null coalesce operator ?? therefore will never query the Config API even if there's no key set in the environment.
Addressable.php line 70:
if (!empty($customRegex = Config::inst()->get('Addressable', 'set_postcode_regex'))) {
having an expression in empty() is not supported by PHP less than 5.5:
Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.
Can you divide this into tow lines please?
The <address>
element is probably being used inappropriately here. See: http://html5doctor.com/the-address-element/
Hi,
I'm having issues with version 5.0.3 in the way the api keys are set and get by getenv(
Are you planning to release the changes 5.0.3...master as 5.0.4?
Thanks,
Bart
When set_allowed_countries() has been set the country name is unavailable.
What I think is happening is when allowedCountries is set the value of Country is a number rather than the two character country abbreviation. When Country is then passed to Zend_Local::getTranslation() in getCountryName() Country is an invalid value.
Is it necessary to require cms? I am building an app that doesn't require the cms component of SilverStripe.
Is framework enough for this module to work?
Tried out Addressable on a standard page class and it works great! However, if I assign it to a DataObject that's part of a GridField, no bueno! So...question is: How can this be updated to allow for a model within GridField to use this? :)
For us in the UK we have a different address format - is there a chance of changing this?
(e.g. postcode contains letters and numbers)
In GeocodeService Config::inst()->get(__CLASS__, 'google_api_key');
return null, becuase __CLASS__
returns an empty string.
If I use self::class instead it works:
SS version: 4.4
Php version: 7.2
Module is not internationalized.
I can provide italian translations of the fields if needed.
In the spec for getFrontEndFields on DataObject the returning object is a note: Always returns a simple field collection without TabSet
The use of the updateCMSFields function inside updateFrontEndFields at line 76 inserts a TabSet which then can't find the tab "Root", as DataObject's getFrontEndFields function returns a TabSet-less FieldList
Running getFrontEndFields on an Geocodable extended page calss gives the error:
FieldList::addFieldToTab() Tried to add a tab to object 'FieldList' - 'Root' didn't exist.
...at line 76 of Geocodable
so the below in DataObject triggers the updateFrontEndFields in Addressable.
public function getFrontEndFields($params = null)
{
$untabbedFields = $this->scaffoldFormFields($params);
$this->extend('updateFrontEndFields', $untabbedFields);
return $untabbedFields;
}
the issue i am getting is that '$untabbedFields' already contains an 'Address' field (not because of my $db setups... i think) and so the below is never entered
public function updateFrontEndFields(FieldList $fields)
{
if (!$fields->dataFieldByName("Address")) {
$fields->merge($this->getAddressFields());
}
}
any ideas or is this a known bug? thanks~!
It appears that sites using this module cannot upgrade to the latest framework version as the guzzle requirements conflicts.
Addressable 5.0.3
{
"name": "symbiote/silverstripe-addressable",
"require": {
"guzzlehttp/guzzle": "^5.3.1|^6.2.1"
Framework 4.11.0
{
"name": "silverstripe/framework",
"require": {
"guzzlehttp/guzzle": "^7",
"guzzlehttp/psr7": "^2",
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.