Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:08
    dominik
    0

    Old items still exists

    Hello,

    I installed the tool and changed unVersion.config to

    <?xml version="1.0"?>
    <unVersionConfig>
      <add maxCount="5" />
    </unVersionConfig>

    i changed the content of a page and clicked "publish" but in the "rollback" window i still see about 300 lines

    I am using umbraco version 4.7.0

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:12
    Matt Brailsford
    0

    Hi Dominik,

    Have you tried restarting your app pool?

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:15
    dominik
    0

    Hi Matt,

    I just restarted but again all old items still exists in the rollback dropdown

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:19
    Matt Brailsford
    0

    Hi Dominik,

    And you republished the page after you restarted the app pool?

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:20
    dominik
    0

    yes i republished the content site but still there are all old items inside the rollback dropdown.

    But i think it should only show the last 5 items or?

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:23
    Matt Brailsford
    0

    Hi Dominik,

    You're right, it should only list 5 items. I'll have to try and do some testing as I haven't really done any tests on 4.7 yet, so it might just be a compatability issue.

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:27
    dominik
    0

    ok this would be great because our database is getting bigger and bigger.

    Will your package delete the old files from database or have i to run any manually script?

     

    Thanks for all your help

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:30
    Matt Brailsford
    0

    unVersion should limit the number of versions a node will save. It does this on a node by node basis (ie, when you save a node, it'll trim it's version history). If you want to do a batch job to clear out a lot of history, you might want to try the house keeping package by the farm

    http://our.umbraco.org/projects/backoffice-extensions/falm-housekeeping

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:34
    dominik
    0

    So if i set in the config maxCount="5" it shows only the latest 5 items but in the database the old items still exists?

    Or will it only store the latest 5 versions in the databas. This is what we want to do so the database is not getting bigger and bigger

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:36
    Matt Brailsford
    0

    It will only store the latest 5 versions in the database.

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:37
    dominik
    0

    THis is great. So we have to look why it is not working with umbraco version 4.7.0

    Perhaps you can check it on your site and tell me what i have to change.

    Thanks a lot

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 21, 2011 @ 16:38
    Matt Brailsford
    0

    I will give it a try this evening and get back to you.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 21, 2011 @ 16:39
    dominik
    0

    Hi Matt,

    I just tested it with a new created content site - and here it seems to work.

    But an old created item still shows all of the old versions and not only the latest 5 (also after republishing)

    Perhaps this information helps?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 09:15
    Matt Brailsford
    0

    Hi Dominik,

    I've tried it this morning, and it is working fine for me. I'm wondering if it's not liking the amount of versions it's being told to delete. Have you had a look in  your log table for anything that might be related?

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 09:27
    dominik
    0

    Hi Matt,

    Sorry i am really an umbraco Newbie but i just installed your package and for new sites it only stores 5 versions (like i have configured it in the config) but all old sites still have about 200 hunder entries in the dropdown list.

    It looks like it has not done the changes for all old sites

    Regards

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 09:46
    Matt Brailsford
    0

    Hi Dominik,

    I'm not sure what else I can suggest. I've just created 200 versions of a node on my local install, setup unversion the same as yourself, recycled my app pool, and republished the node and it has successfully removed the old revisions. The fact that it's also working on new installs to me suggests it's something else causing a conflict.

    Maybe try using the farm houskeeping package I mentioned earlier to clear out the old revisions, then see if setting up unversion once you have cleared out the backlog makes it work.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 10:06
    dominik
    0

    Can you please tell me how you have exactly recycled your app pool. I have just restartet the app pool for this site and republished the item

    But still there are 200 versions in the dropdown.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 10:21
    Matt Brailsford
    0

    Hi Dominik,

    I just made a slight change to the web.config and resaved it, but recycling it via IIS should do the same task.

    Have you tried republishing a node that has less than 200 revisions but within the same install to see if it's a site wide issue, or just for nodes with lots of revisions?

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 10:25
    dominik
    0

    HI Matt,

    I just tried it with an old site that has about 15 dropdown lines.

    After republishing it shows again 15 items and not only 5.

    I think it is a problem with old items. New items are working great.

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 10:28
    Matt Brailsford
    0

    Hi Dominik,

    There really shouldn't be any difference between new and old nodes as far as UnVersion is concerned.

    Can you have a look in the umbracoLog table in your database to see if there is anything in there that sounds like it might be related. That table is where any log messages are written to.

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 10:32
    dominik
    0

    I just published it again and looks into the logfile.

    But only 2 inserts have been done one is "Publish" and one is "Debug" with info "Xml savend in ....:"

    I can not see any problem :-(

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 10:47
    Matt Brailsford
    0

    Hi Dominik,

    As I can't replicate here myself, my best suggestion would be to download the source for the plugin and debug into it to see what's going on. You can get the source from codeplex at http://unversion.codeplex.com/. It's not a very complex plugin, so you shouldn't have too much dificuilty debugging. Everything pretty much happens in the AppBase class.

    Best of luck.

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 10:56
    dominik
    0

    Hi Matt,

    Perhaps you can tell me the select statement where you select all of the old items. THan i can try to select this direct in the database and look if he will find any old items.

    I think it is this one or?

    SELECT cv.VersionId, cv.VersionDate, d.published, d.newest FROM cmsContentVersion cv LEFT OUTER JOIN cmsDocument d ON d.versionId = cv.VersionId WHERE cv.ContentId = {0} ORDER BY cv.VersionDate DESC
  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:00
    dominik
    0

    Hi Matt,

    I tried this statement with an id of my document and it shows exactly the 19 lines. So i think something is wrong with the delete statement or the system is never running the deletion script?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:04
    Matt Brailsford
    0

    HI Dominik,

    That SQL query will list ALL revisions for a node. Unversion then loops through them all and determins whether it should be kept or deleted, then deletes all those flagged for deletion.

    As I say, your best bet will be to download and debug through the source. This should tell you if there are any exceptions while it tries to delete the revisions.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:08
    dominik
    0

    Hi Matt, Sorry i do not now how i can debug it.

    I can download the project and open it with VS 2010 but I think it will not find any database connection or?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:14
    Matt Brailsford
    0

    Hi Dominik,

    If you just compile it in debug mode, then drop the .dll and .pdb file into your websites bin folder, you should then be able to attach Visual Studio to your websites w3wp.exe worker process (Ctrl + Alt + P, you might have to set it to display processes from all users and all processes in all session) which should allow you to set breakpoints in the AppBase class and see what is going on.

    Hope that helps

    Cheers

    Matt

     

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:19
    dominik
    0

    Hi Matt,

    If i opening your project he is not getting the links to the umbraco dlls so I think i can not just open the project in VS2010.

    Is there any tutorial which describes how i can debug a third party project with umbraco?

    My umbraco is running on local IIS server.

    Thanks

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:24
    Matt Brailsford
    0

    Hi Dominik,

    Just update the references to point to the umbraco dlls in your websites bin folder, that should be enough to get it to compile, then the debug process is just that which I outlined in my previous comment.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:35
    dominik
    0

    Hi Matt,

    Ok I edited the references but can you please tell me how i can compile it in debug mode? If i click debug it is trying to open the project

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:37
    Matt Brailsford
    0

    Hi Dominik,

    Just ensure "Debug" is selected in the build configuration dropdown, and then just build the project (Ctrl + Shift + B). Then you should find the dll / pdb file in the projects bin folder. Just copy those over to your websites bin folder.

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:41
    dominik
    0

    ok this works - but if i try to add breakpoints in the ApplicationBase.cs it always says that i am not allowed to set breakpoints there.

    shall i now try to publish an old site againg.

    Where i have to look after this so i can see where the problem appears?

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:48
    dominik
    0

    Hi Matt,

    Ok now i was able to debug.

    Some things i have seen

    - It will go into the  if (versionNo >= 45000) statment

    - The versionsToKeepString includes not only 5 items - it include all 19 items - i think here is the problem or?

    I think versionsToKeepString should only include 5 items not all 19

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:51
    Matt Brailsford
    0

    Hi Dominik,

    You should be able to set a breakpoint at the place where it is doing the SQL query you posted earlier. You should then be able to step through the rest of the code to see what is going on.

    Once you are connected to your website's w3wp process, you should then be able to just publish a node and watch the UnVersion plugin event handler trigger stopping at your breakpoint.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:53
    dominik
    0

    HI Matt,

    Yes it is working - but versionsToKeepString includes all 19 items not only 5 items

    I think this is the problem or?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 11:55
    Matt Brailsford
    0

    Ok, then when you are debugging, take a look at the value of configEntry.MaxCount and check this is set to 5. Also check the rest of the arguments in this statement:

    if(published || newest || readerIndex <= configEntry.MaxCount || (versionDate - DateTime.Now).Days < configEntry.MaxDays)

    As this is what determins which items should get deleted, so it sounds like something is getting through that shouldn't be. Which to me, would suggest the config wasn't loaded correctly, or it is badly formatted.

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 11:58
    dominik
    0

    Hi Matt

    MaxCount  is 5

    MaxDays is 0

    I think config is read correct because for new items all is working - only old items are not deleted

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:02
    Matt Brailsford
    0

    Then the only way they can become part of the versionsToKeepString is if they are the current published version, or the newest draft entry. Can you check whether either of these is always coming through as true (you should only every have 1 published and 1 newest revision for any given node).

    If one of these is reposting a constant true state, then it sounds like it's down to some corrupt data, as there should only ever be one of each for any given node.

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:03
    dominik
    0

    RootXPath is null

    Perhaps this is an problem?

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:04
    dominik
    0

    I looked in the database with the select - one item is published and one other item is newest

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:04
    Matt Brailsford
    0

    RootXPath is optional, so shouldn't be a problem that it is null.

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:07
    dominik
    0

    I tried another old site and the database shows 64 rows in cmsContentVersion for this item

    If i debug it the readerIndex is 100 - perhaps this helps

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:14
    Matt Brailsford
    0

    I think you need to check everything that is being checked for in this if statement,

    if(published || newest || readerIndex <= configEntry.MaxCount || (versionDate - DateTime.Now).Days < configEntry.MaxDays)

    as it is the ONLY location that dictates what is kept. If something is in the list to be kept, it is because this if statement allowed it, and if the if statement allowed, one of the following must be true:

    published = true
    newest = true
    readerIndex <= MaxCount
    version date < MaxDays

    published and newest should only be true for one revision for any given node, where readerIndex and version dates should be dependant on the config (which from what you have said, it is coming through correctly).

    You need to figure out which one of those checks is failing, then you can figure out why it is failing, and whether it is an issue with your content, or an issue with UnVersion.

    Cheers

    Matt 

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:21
    dominik
    0

    Hi Matt i found the issue

    If i remove last statement

    ||(versionDate -DateTime.Now).Days< configEntry.MaxDay

    it is working!

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:27
    Matt Brailsford
    0

    Ok, in that case, you might want to check what (versionDate -DateTime.Now).Days is. If it is old data, it should have dates set in the past, and so should be a negative value. The only way I can think that would happen is if all the datas versionDates are set to some time in the future, which shouldn't really happen. 

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:35
    dominik
    0

    In the database all versionDates are in the past

    2011-11-18 12:07:44.623 as an example

    Perhaps it is an issue if i have not set any MayDay?

    regards

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:36
    Matt Brailsford
    0

    I don't suppose the data you are working with was created on a server with it's timezone set differently to your machine? It could be that the dates were stored in one format, and your local machine is parsing them wrongly, making it think the dates are in the future?

    Cheers

    Matt

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 12:39
    Matt Brailsford
    0

    You need to check what the version date is being parsed as in the code rather than what is in the actual database, as it's the code that is making the decisions so it's whatever it perceives the dates to be that matters.

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 12:59
    dominik
    0

    Hi Matt

    VersionDate: Date = {21/11/2011 00:00:00}

    DateTime.Now : Now = {22/11/2011 12:58:12}

    Of course it is a negative number because versiondate is always smaller than DateTime Now

    So it will always be smaller than 0

     

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 13:19
    dominik
    0

    I think it must be

    ||(DateTime.Now - versionDate).Days< configEntry.MaxDay

    or?

    because versionDate will always be smaller than DateTime.Now - so in my case i am always getting a negative number and the condition is true and the items are added to the versionToKeep Array

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 13:21
    Matt Brailsford
    0

    Hi Domink,

    I think you might be right. Strange how it's never come up before now though, oh well, I'll do some more tests to make sure and issue an update.

    You should be able to just use your custom built DLL for the time being.

    Glad you were able to get it to work.

    Many thanks

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 13:24
    dominik
    0

    yes but can you please provide me wiht a complete zip package which will solve this issue?

    I am wondering why this has worked for all others?

    Really strange :-)

    But i am happy to solved it

    So once there is a new package can you please send me a note?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 13:29
    Matt Brailsford
    0

    No problem, I'll post a reply on here to let you know.

    Many thanks

    Matt

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 22, 2011 @ 16:31
    Matt Brailsford
    0

    Ok, v1.4 should be available to download now.

    Cheers

    Matt

  • dominik 711 posts 733 karma points
    Nov 22, 2011 @ 16:45
    dominik
    0

    I think its working now - thanks a lot Matt

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Nov 23, 2011 @ 00:19
    Lee Kelleher
    0

    Hi Dominik, would you be so kind as to mark this topic with a solution?

    Many thanks, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft