Copied to clipboard

Flag this post as spam?

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


  • Sander Houttekier 114 posts 163 karma points
    Sep 01, 2009 @ 16:20
    Sander Houttekier
    0

    Issues with creation of new nodes.

    Hi,

    i tried implementing it in a current site we are building, just to test it and use it if it works as we want to.
    the description seems to be more than enough for the needs of this current site.

    though i have a little trouble implementing it.

    for our own convenience we want to store news and events in a date folder structure... but for some xslts's we want to devide them
    into 2 groups, instead of using the same document types for the datefolders. so first step, i created 2 doctypes:
    - News Date Folder (NewsDateFolder)  -- [added as allowed child on the news container doctype, and has NewsArticle as allowed childtype]
    - Event Date Folder (EventDateFolder)  -- [added as allowed child on the events container doctype, and has Event as possible allowed child]

    then, i installed your package
    and started configurating your config file where i added the following doctypes

        <DocTypes>
            <DocType alias="NewsArticle" folderProvider="NewsDateFolder"/>
            <DocType alias="Event" folderProvider="EventDateFolder"/>
        </DocTypes>


    after that i duplicated the existing provider and named them according to the (news... and event...)

            <FolderProvider alias="EventDateFolder"
                    assembly="/bin/AutoFolders"
                    type="AutoFolders.Providers.DateFolderProvider"
                    TruncatedFolderUrl="folder-1/folder-2/event">
                <Property alias="FolderDocType">EventDateFolder</Property>
                <Property alias="MonthFormat">MM</Property>
                <Property alias="YearFormat">yyyy</Property>
            </FolderProvider>
            <FolderProvider alias="NewsDateFolder"
                    assembly="/bin/AutoFolders"
                    type="AutoFolders.Providers.DateFolderProvider"
                    TruncatedFolderUrl="folder-1/folder-2/newsitems">
                <Property alias="FolderDocType">NewsDateFolder</Property>
                <Property alias="MonthFormat">MM</Property>
                <Property alias="YearFormat">yyyy</Property>
            </FolderProvider>

    i think i did this the way it has to be done... i removed the dayformat for both, i named the folderprovider alias to the ones i use in the doctypes
    and i added the folderdoctype to the ones i created in umbraco.

     

    now the result of all this is:

    when i right click on the newscontainer, and create a newsArticle, it gives a null reference error, in the create window,
    i saw that he did create a few items but not all of them are shown, for example if i added newsDateFolder manually for 2009, he named it:
    2009 (1)  so meaning a 2009 is already present, though not visible (not even with refreshing the tree) so i suppose due to the null reference error it didn't get to finish his logic ...

    anyway, if you see any big mistakes i did, i would be glad to learn about them, however if we do not find a solution to this soon we will just use the other datefolder package which we already used in sites before (and experiment with this one further before adding it into production environements)

     

    Sander

  • Chris Koiak 700 posts 2626 karma points
    Sep 01, 2009 @ 21:09
    Chris Koiak
    0

    Hi Sander,

    You seem to have correct settings files.

    A few things to check...

    1. Do your two folder doc types support themselves as children?
    2. Check the spelling of your doc types.
    3. Does the same error exist for event pages?

    Can you post the null pointer error?

    Finally, try building the code in debug and tell me the object that's null.

    Cheers,

    Chris

  • Sander Houttekier 114 posts 163 karma points
    Sep 01, 2009 @ 23:52
    Sander Houttekier
    0

    hi,

    1) yes they support themself as childnodes...
    2) they are copy pasted from the umbraco settings section so i believe the spelling cannot be an issue in this case
    3) i cannot say if it exists for the events, as i removed everything for events because i had to test other code and i needed to be able to create new events for that. i will put it back tomorrow and see if it remains the same for events.


    the null reference exception goes like this:

    Server Error in '/' Application.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.cms.businesslogic.web.Document.XmlPopulate(XmlDocument xd, XmlNode& x, Boolean Deep) +2276
    umbraco.cms.businesslogic.web.Document.XmlGenerate(XmlDocument xd) +141
    umbraco.cms.businesslogic.CMSNode.Move(Int32 NewParentId) +1280
    AutoFolders.ApplicationBase.Document_New(Document sender, NewEventArgs e) +471
    umbraco.cms.businesslogic.web.Document.OnNew(NewEventArgs e) +129
    umbraco.cms.businesslogic.web.Document.MakeNew(String Name, DocumentType dct, User u, Int32 ParentId) +1974
    umbraco.contentTasks.Save() +216
    umbraco.presentation.create.dialogHandler_temp.Create(String NodeType, Int32 TypeId, Int32 NodeId, String Text) +1131
    umbraco.cms.presentation.create.controls.content.doCreation() +379
    umbraco.cms.presentation.create.controls.content.sbmt_Click(Object sender, EventArgs e) +58
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +130
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +38
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3214



    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

  • Chris Koiak 700 posts 2626 karma points
    Sep 02, 2009 @ 00:19
    Chris Koiak
    0

    The logic works as follows...

    • Page is created.
    • Event handler kicks in and creates the child folder nodes.
    • The original page is moved to the new location.

    It would appear that the final step is failing. This may be due to incorrect params being passed to the umbraco move command.

    Can you try disabling the plugin (del the dll), creating some NewsDateFolders and then moving a newsarticle between these folders. Trying to rule out move permission issues.

    If that fails you'll need to create a debug build from the code and inspect the move parameters for correctness. 

    If that fails, I'll rebuild a new version with better error handling and reporting..... some point tomorrow.

     

     

  • Chris Koiak 700 posts 2626 karma points
    Sep 02, 2009 @ 00:38
    Chris Koiak
    0

    another think to check...you don't have any other event handler code running?

    This may be included in other packages like blog4umbraco, etc...

  • Sander Houttekier 114 posts 163 karma points
    Sep 02, 2009 @ 15:07
    Sander Houttekier
    0

    no, we have a clean install, no packages other than imagegen and xsltsearch are added besides your autoform so it is no conflict between other handles. (as we also didnt write any handlers ourself yet too...)

    and without the package installed (dll removed, and config commented or moved outside of umbraco dir)
    the creation of nodes works perfect, can make datefolders then add news articles underneath, etc... move them around also.

    anyway, it is not that this package is bad, i believe it is very promissing, but at this point i do not plan to add it into this project again since we are already running behind on schedule i will keep the package and test around with it in my personal time first before trying to implement it right away.

    thanks for the help and i will get back to this thread if i stumble on implementation problems in the test project then. (since i want to know what the problem is i will create a backup of this project so far and use that as the test project, want the parameters to be exactly the same as we have them now.)

    Sander

  • Chris Koiak 700 posts 2626 karma points
    Sep 02, 2009 @ 16:04
    Chris Koiak
    0

    Sander,

    Can you email me your test backup/install as I'm keen to get to the bottom of this. Feel free to blank any branding/client/template info.

    chris no_spaces koiak {{at}} g mail

    Cheers,

    Chris

     

  • Chris Koiak 700 posts 2626 karma points
    Sep 03, 2009 @ 20:52
    Chris Koiak
    0

    Hi Sander,

    I've just used this package again in another project, hoping to encounter the issues you have, but it worked fine. Damn!

    Please send me your install so I can replicate and fix this issue.

    Cheers,

    Chris

Please Sign in or register to post replies

Write your reply to:

Draft