2000 Posts in 532 Topics by 435 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » SS 2.3.3 and ecommerce 0.6 error in object.php when installing and dev/build
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1094 Views |
-
SS 2.3.3 and ecommerce 0.6 error in object.php when installing and dev/build

17 August 2009 at 7:19pm
Hello!
We got a error message when we tried to install ecommerce 0.6 width Silverstripe version 2.3.3 in object.php, line 405. We had to comment out this lines, then it worked good. But we worrie about that commenting out this lines could cause an other error someplace in the system. The code looks like this (we commented out the last lines):
/**
* Add an extension to a specific class.
* As an alternative, extensions can be added to a specific class
* directly in the {@link Object::$extensions} array.
* See {@link SiteTree::$extensions} for examples.
* Keep in mind that the extension will only be applied to new
* instances, not existing ones (including all instances created through {@link singleton()}).
*
* @param string $class Class that should be decorated - has to be a subclass of {@link Object}
* @param string $extension Subclass of {@link Extension} with optional parameters
* as a string, e.g. "Versioned" or "Translatable('Param')"
*/
public static function add_extension($class, $extension) {
if(!preg_match('/^([^(]*)/', $extension, $matches)) {
return false;
}
$extensionClass = $matches[1];
if(!class_exists($extensionClass)) {
user_error(sprintf('Object::add_extension() - Can\'t find extension class for "%s"', $extensionClass), E_USER_ERROR);
}
if(!is_subclass_of($extensionClass, 'Extension')) {
user_error(sprintf('Object::add_extension() - Extension "%s" is not a subclass of Extension', $extensionClass), E_USER_ERROR);
}
// unset some caches
self::$cached_statics[$class]['extensions'] = null;
$subclasses = ClassInfo::subclassesFor($class);
$subclasses[] = $class;
if($subclasses) foreach($subclasses as $subclass) {
unset(self::$classes_constructed[$subclass]);
}
// merge with existing static vars
self::add_static_var($class, 'extensions', array($extension));
// load statics now for DataObject classes
//if(is_subclass_of($class, 'DataObject')) {
//DataObjectDecorator::load_extra_statics($class, $extensionClass);
//}
}Has anyone had this problem, and is it a better way to solve it? Any suggestions?
Have a nice day from Norway!
-
Re: SS 2.3.3 and ecommerce 0.6 error in object.php when installing and dev/build

3 September 2009 at 9:43pm
Hi Siv,
What error did you receive? If you're able to reproduce it (or have got it saved somewhere) could you post it here?
Thanks!
| 1094 Views | ||
|
Page:
1
|
Go to Top |


