Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReflectionException: Class VersionedDataObject does not exist #161

Open
dacar opened this issue May 30, 2017 · 8 comments
Open

Comments

@dacar
Copy link

dacar commented May 30, 2017

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
Copy link
Member

jsirish commented May 30, 2017

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
Copy link
Author

dacar commented May 30, 2017

"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
Copy link
Author

dacar commented May 30, 2017

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
Copy link
Member

jsirish commented May 30, 2017

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
Copy link
Author

dacar commented May 30, 2017

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
Copy link
Author

dacar commented May 30, 2017

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
Copy link
Author

dacar commented May 30, 2017

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

@dacar
Copy link
Author

dacar commented May 30, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants