Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Releases and Announcements /

Latest news about the SilverStripe software.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

2.4 deletion bug?


Reply


5 Posts   2070 Views

Avatar
webtonic

Community Member, 26 Posts

20 July 2010 at 10:25am

Hi Guys

I am running 2.4 and have a couple of unusual things going on.
1) I am asked to login whenever I change a page type
2) When deleting a page, when I view the site I get this error
Debug (Versioned::get_latest_version() in line 851 of Versioned.php)

SELECT "SiteTree_versions"."ClassName", "SiteTree_versions"."Created", "SiteTree_versions"."LastEdited", "SiteTree_versions"."URLSegment", "SiteTree_versions"."Title", "SiteTree_versions"."MenuTitle", "SiteTree_versions"."Content", "SiteTree_versions"."MetaTitle", "SiteTree_versions"."MetaDescription", "SiteTree_versions"."MetaKeywords", "SiteTree_versions"."ExtraMeta", "SiteTree_versions"."ShowInMenus", "SiteTree_versions"."ShowInSearch", "SiteTree_versions"."HomepageForDomain", "SiteTree_versions"."ProvideComments", "SiteTree_versions"."Sort", "SiteTree_versions"."HasBrokenFile", "SiteTree_versions"."HasBrokenLink", "SiteTree_versions"."Status", "SiteTree_versions"."ReportClass", "SiteTree_versions"."CanViewType", "SiteTree_versions"."CanEditType", "SiteTree_versions"."ToDo", "SiteTree_versions"."Version", "SiteTree_versions"."Priority", "SiteTree_versions"."ParentID", "Page_versions"."PageHeader", "Page_versions"."HeaderImageTitle", "Page_versions"."HeaderTagLine", "Page_versions"."HeaderLogoID", "Page_versions"."HeaderImageID", "GalleryPage_versions"."UrlLinkID", "GalleryPage_versions"."GalleryPhotoID", "ThreeColumnPage_versions"."ColumnContent1", "ThreeColumnPage_versions"."ColumnContent2", "ThreeColumnPage_versions"."ColumnContent3", "ThreeColumnPage_versions"."ShowColumns", "ThreeColumnPage_versions"."ImageaID", "ThreeColumnPage_versions"."ImagebID", "ThreeColumnPage_versions"."ImagecID", "ErrorPage_versions"."ErrorCode", "RedirectorPage_versions"."RedirectionType", "RedirectorPage_versions"."ExternalURL", "RedirectorPage_versions"."LinkToID", "VirtualPage_versions"."VersionID", "VirtualPage_versions"."CopyContentFromID", "SiteTree_versions"."ID", CASE WHEN "SiteTree_versions"."ClassName" IS NOT NULL THEN "SiteTree_versions"."ClassName" ELSE 'SiteTree' END AS "RecordClassName", "SiteTree_versions"."RecordID", "SiteTree_versions"."Version", "SiteTree_versions"."WasPublished", "SiteTree_versions"."AuthorID", "SiteTree_versions"."PublisherID", "SiteTree_versions"."RecordID" AS "ID" FROM "SiteTree_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "Page_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "GalleryPage_versions" ON "GalleryPage_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "GalleryPage_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "ThreeColumnPage_versions" ON "ThreeColumnPage_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "ThreeColumnPage_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "ErrorPage_versions" ON "ErrorPage_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "ErrorPage_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "RedirectorPage_versions" ON "RedirectorPage_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "RedirectorPage_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "VirtualPage_versions" ON "VirtualPage_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "VirtualPage_versions"."Version" = "SiteTree_versions"."Version" WHERE ("SiteTree_versions"."RecordID" = 10) ORDER BY "SiteTree_versions"."Version" DESC LIMIT 1

Debug (Versioned::get_latest_version() in line 852 of Versioned.php)

* ClassName =

* Created =

2010-07-13 11:57:38

* LastEdited =

2010-07-20 09:24:08

* URLSegment =

fleur-daily

* Title =

Fleur Daily

* MenuTitle =

* Content =

<h2>A floral treat!</h2>
<p><br/>Looking for that special floral gift? Youâ??ve found it.<br/>Bring color and fragrance into someoneâ??s life.<br/><br/>The Fleur Daily cupcake flower vase is a deliciously sweet, 100% fat free gift for birthdays, Motherâ??s Day and baby showers. Soft yet durable construction makes these the ideal vase or bud vase for hospitals and rest homes. Designed with florists in mind these cupcakes vases are quick and easy to decorate or you can add a personal touch by decorating the cupcake vase yourself.<br/>With six colors, these easy to coordinate cupcake vases make perfect cupcake table center pieces for weddings and other special occasions.  </p>
<ul><li>Spill resistant and non breakable;</li>
<li>Plush, safe EVA, is re-usable and recyclable</li>
<li>placement holes make for quick, easy arranging, less evaporation and helps prevent messy spills;</li>
<li>To fill or clean, simply squeeze the top to open;</li>
</ul><p>Highly recommended for Florists, gift stores, garden centers, and wedding planners.<br/><br/>For more information please visit <a href="http://www.josterstore.com/Cupcake_Vase" target="_blank">josterstore.com/Cupcake_Vase</a><br/>Wholesale Inquiries <a class="" href="[sitetree_link id=8]">click here</a>.</p>

* MetaTitle =

Fleur Daily

* MetaDescription =

* MetaKeywords =

* ExtraMeta =

* ShowInMenus =

1

* ShowInSearch =

1

* HomepageForDomain =

* ProvideComments =

0

* Sort =

2

* HasBrokenFile =

0

* HasBrokenLink =

1

* Status =

Saved (update)

* ReportClass =

* CanViewType =

Anyone

* CanEditType =

LoggedInUsers

* ToDo =

* Version =

34

* Priority =

1.0

* ParentID =

0

* PageHeader =

Cupcake Flower Vase

* HeaderImageTitle =

* HeaderTagLine =

Enjoy Flowers everyday

* HeaderLogoID =

6

* HeaderImageID =

84

* UrlLinkID =

0

* GalleryPhotoID =

0

* ColumnContent1 =

* ColumnContent2 =

* ColumnContent3 =

* ShowColumns =

* ImageaID =

* ImagebID =

* ImagecID =

* ErrorCode =

* RedirectionType =

* ExternalURL =

* LinkToID =

* VersionID =

* CopyContentFromID =

* ID =

10

* RecordClassName =

* RecordID =

10

* WasPublished =

1

* AuthorID =

1

* PublisherID =

1

[User Error] Versioned::get_version: Couldn't get SiteTree.10
GET /~josterc/

Line 853 in /home/josterc/public_html/sapphire/core/model/Versioned.php
Source

844       $query = singleton($class)->buildVersionSQL("\"{$baseTable}\".\"RecordID\" = $id", "\"{$baseTable}\".\"Version\" DESC");
845       $query->limit = 1;
846       $record = $query->execute()->record();
847       if(!$record) return;
848       
849       $className = $record['ClassName'];
850       if(!$className) {
851          Debug::show($query->sql());
852          Debug::show($record);
853          user_error("Versioned::get_version: Couldn't get $class.$id", E_USER_ERROR);
854       }
855
856       Versioned::set_reading_mode($oldMode);
857
858       return new $className($record);
859    }

Trace

* Versioned::get_version: Couldn't get SiteTree.10
Line 853 of Versioned.php
* Versioned::get_latest_version(SiteTree,10)
Line 344 of SiteTree.php
* SiteTree::link_shortcode_handler(Array,,ShortcodeParser,sitetree_link)
* call_user_func(Array,Array,,ShortcodeParser,sitetree_link)
Line 146 of ShortcodeParser.php
* ShortcodeParser->handleShortcode(Array)
* preg_replace_callback(/(.?)\[(sitetree_link)(.*?)(\/)?\](?(4)|(?:(.+?)\[\/\s*\2\s*\]))?(.?)/s,Array,<h1>Fleur Daily</h1> <h2>Floral Cupcake Vase</h2> <p>Our unique floral cupcake vases make perfect accessories for weddings and other special occasions.</p> <p>Ideal gifts for birthdays, Motherâ??s Day, baby showers, hospitals and rest homes. <a href="[sitetree_link id=10]">Read more â?¦</a></p>)
Line 118 of ShortcodeParser.php
* ShortcodeParser->parse(<h1>Fleur Daily</h1> <h2>Floral Cupcake Vase</h2> <p>Our unique floral cupcake vases make perfect accessories for weddings and other special occasions.</p> <p>Ideal gifts for birthdays, Motherâ??s Day, baby showers, hospitals and rest homes. <a href="[sitetree_link id=10]">Read more â?¦</a></p>)
Line 115 of HTMLText.php
* HTMLText->forTemplate()
Line 446 of ViewableData.php
* ViewableData->XML_val(ColumnContent1,,1)
Line 81 of .cache.home.josterc.public_html.themes.joster.templates.Layout.ThreeColumnPage.ss
* include(/tmp/silverstripe-cache-home-josterc-public_html/.cache.home.josterc.public_html.themes.joster.templates.Layout.ThreeColumnPage.ss)
Line 392 of SSViewer.php
* SSViewer->process(HomePage_Controller,Zend_Cache_Frontend_Output)
Line 383 of SSViewer.php
* SSViewer->process(HomePage_Controller)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 134 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
* ModelAsController->handleRequest(SS_HTTPRequest)
Line 111 of RootURLController.php
* RootURLController->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
* Director::direct(/)
Line 127 of main.php
Site is running in dev mode.
Can anyone shed some light on these to issues?

thanks
Craig

Avatar
prawnstar

Community Member, 127 Posts

10 November 2010 at 9:52am

I'm having the same issue. Happened after I did a bulk delete of pages.

The problem only affects /admin for me. I'm kinda hosed here until I figure this out.

Chris.b

Avatar
Pranil

Community Member, 17 Posts

30 November 2010 at 12:17pm

Hey guys

Ran in to the same problem when doing a bulk delete, found I could still access /admin/assets and so on, was just /admin that was error'ing out. Rolled back to an earlier version of the site (thank you git!), and synced with the production db. Still had the same problem.
Found that I could log in sweet as on a different browser (usually use FF, tried chrome), so figured it might be a caching issue. Weird that ?flush=all wasn't fixing it though. Deleted recent history in FF, and it's all working sweet now.
Give this a whirl and see how ya go, cheers.

Avatar
MonkeyBen

Community Member, 25 Posts

30 March 2011 at 5:56am

I have just had this problem. I found the cookie was the problem. Clear your cookies and you should be able to re-login using the same browser :)

Avatar
johnmblack

Community Member, 61 Posts

19 May 2011 at 2:25am

see http://silverstripe.org/data-model-questions/show/12628 for the same symptoms; for some people the solution there seemed to work.