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
Issues with non existent version / language change #6
Comments
@jedateach This is full debug for the error on back-end: user_error(Versioned::get_version: Couldn't get Product.313, version 3,256) line 980 of Versioned.php Versioned::get_version(Product,313,3) line 660 of Product.php Product_OrderItem->Product() line 669 of Product.php Product_OrderItem->UnitPrice() line 169 of OrderItem.php OrderItem->Total() line 504 of Order.php Order->SubTotal() line 618 of Order.php Order->Total() line 369 of ViewableData.php ViewableData->obj(Total,,,) line 446 of ViewableData.php ViewableData->XML_val(Total) line 1367 of TableListField.php TableListField_Item->Fields() line 369 of ViewableData.php ViewableData->obj(Fields) line 843 of .cache.sapphire.templates.TableListField.ss include( D:\server\www\SilverStripe-v2.4.7\silverstripe-cache.cache.sapphire.templates.TableListField.ss) line 429 of SSViewer.php SSViewer->process(TableListField) line 342 of ViewableData.php ViewableData->renderWith(TableListField) line 319 of TableListField.php TableListField->FieldHolder() line 369 of ViewableData.php ViewableData->obj(FieldHolder,,,1) line 446 of ViewableData.php ViewableData->XML_val(FieldHolder,,1) line 77 of .cache.sapphire.templates.Includes.Form.ss include( D:\server\www\SilverStripe-v2.4.7\silverstripe-cache.cache.sapphire.templates.Includes.Form.ss) line 429 of SSViewer.php SSViewer->process(Form) line 342 of ViewableData.php ViewableData->renderWith(Array) line 1108 of Form.php Form->forTemplate() line 659 of ModelAdmin.php ModelAdmin_CollectionController->search(Array,Form) line 47 of StoreAdmin.php StoreAdmin_CollectionController->search(Array,Form,SS_HTTPRequest) line 329 of Form.php Form->httpSubmission(SS_HTTPRequest) line 143 of RequestHandler.php RequestHandler->handleRequest(SS_HTTPRequest) line 161 of RequestHandler.php RequestHandler->handleRequest(SS_HTTPRequest) line 147 of Controller.php Controller->handleRequest(SS_HTTPRequest) line 161 of RequestHandler.php RequestHandler->handleRequest(SS_HTTPRequest) line 147 of Controller.php Controller->handleRequest(SS_HTTPRequest) line 282 of Director.php Director::handleRequest(SS_HTTPRequest,Session) line 125 of Director.php Director::direct(/admin/orders/Order/SearchForm) line 127 of main.php |
To know the problem more I've added a product in English and I've added the same product in French, so on English front-end when I added the product to the cart and switch back to French and I get the following problem:
Debug (Versioned::get_version() in line 978 of Versioned.php)
SELECT "SiteTree_versions"."ClassName", ....
Debug (Versioned::get_version() in line 979 of Versioned.php)
(bool) false
[User Error] Versioned::get_version: Couldn't get Product.389, version 2
GET /SilverStripe-v2.4.7/products/filter/
Line 980 in D:\server\www\SilverStripe-v2.4.7\sapphire\core\model\Versioned.php
Source
971 Versioned::set_reading_mode('');
972
973 $baseTable = ClassInfo::baseDataClass($class);
974 $query = singleton($class)->buildVersionSQL(""{$baseTable}"."RecordID" = $id AND "{$baseTable}"."Version" = $version");
975 $record = $query->execute()->record();
976 $className = $record['ClassName'];
977 if(!$className) {
978 Debug::show($query->sql());
979 Debug::show($record);
980 user_error("Versioned::get_version: Couldn't get $class.$id, version $version", E_USER_ERROR);
981 }
982
983 Versioned::set_reading_mode($oldMode);
984 return new $className($record);
985 }
986
The text was updated successfully, but these errors were encountered: