dynamic / silverstripe-locator

SilverStripe Locator Module. Show locations on a map. Search by geoposition.
http://www.dynamicagency.com/labs/silverstripe-locator-module/
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

Uncaught ReflectionException: Class VersionedDataObject does not exist #161

Open dacar opened 7 years ago

dacar commented 7 years ago

After /dev/build/?flush=1 i get the following error. Can you please help and give advice?

Source 5 /* 6 A class for creating new objects by the injector. 7 8 @package framework 9 @subpackage injector 10 / 11 class InjectionCreator implements Factory { 12 13 public function create($class, array $params = array()) { 14 $reflector = new ReflectionClass($class); 15 16 if (count($params)) { 17 return $reflector->newInstanceArgs($params); 18 } 19 20 return $reflector->newInstance(); Trace ReflectionClass->__construct(VersionedDataObject) InjectionCreator.php:14 InjectionCreator->create(VersionedDataObject,Array) Injector.php:555 Injector->instantiate(Array) Injector.php:864 Injector->get(VersionedDataObject,,Array) Injector.php:902 Injector->createWithArgs(VersionedDataObject,Array)

jsirish commented 7 years ago

HI @dacar

Could you let us know which version of Locator you're using? Also, did you install via Composer?

We added versioning to Locations after 2.0.0-alpha2. 2.0.0-beta1 and after require heyday/silverstripe-versioneddataobjects

dacar commented 7 years ago

"extra": { "installer-name": "locator", "branch-alias": { "2.0": "2.0.x-dev" } }

Ifi remove the following from locator.php it works. private static $extensions = [ 'VersionedDataObject', ];

dacar commented 7 years ago

Hi @jsirish

sorry, it's late at night in germany. I have forgotten to say hi and i have forgotten to say that i have installed manually.

jsirish commented 7 years ago

No worries!

If you've installed Locator manually just also install https://github.com/heyday/silverstripe-versioneddataobjects

The 2.0 branch has a handful of other requirements as well that you'll need to install: https://github.com/dynamic/silverstripe-locator/blob/2.0/composer.json#L22

You can find the GitHub links to all of these packages by searching http://packagist.org

If you're able to use composer instead, it will install all of these for you, and will be easier to maintain future versions as we release them.

https://docs.silverstripe.org/en/3/getting_started/composer/

Hope that helps!

dacar commented 7 years ago

i also get the following javascript error in the frontend:

Uncaught TypeError: $ is not a function at HTMLDocument. (? at fire (jquery.js?m=1495870913:1075) at Object.fireWith (jquery.js?m=1495870913:1193) at Function.ready (jquery.js?m=1495870913:435) at HTMLDocument.DOMContentLoaded (jquery.js?m=1495870913:949) (anonymous) @ ?

fire @ jquery.js?m=1495870913:1075 fireWith @ jquery.js?m=1495870913:1193 ready @ jquery.js?m=1495870913:435 DOMContentLoaded @ jquery.js?m=1495870913:949

$(function(){ $('#map-container').storeLocator({

dacar commented 7 years ago

after changing line 272 in pages/Locator.php

// init map Requirements::customScript(" $(function(){ $('#map-container').storeLocator({

to

            // init map
            Requirements::customScript("
            jQuery(function(){
                jQuery('#map-container').storeLocator({

it works

dacar commented 7 years ago

hmm, on adding or editing categories i get an 500 Server error. Can't see why??

dacar commented 7 years ago

all Modules from https://github.com/dynamic/silverstripe-locator/blob/2.0/composer.json#L22 are installed???