Copied to clipboard

Flag this post as spam?

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


  • Darryl Godden 145 posts 197 karma points
    Jun 22, 2012 @ 15:20
    Darryl Godden
    0

    Image Cropper

    Hi all,

    I've added a data type based on the Image Cropper and dropped this onto a document, however when creating a new item - I get the dreaded object reference not set error.

    As far as I can tell the image cropper is set-up as per other forum posts I have read:

    I observed on one of the other posts a suggestion was to add an Upload control and name the parameter the same as the Property Alias, but the upload control doesn't have such a property in 4.7.

    Any suggestions?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 22, 2012 @ 15:22
    Tom Fulton
    0

    Hi Darryl,

    On your Media Type, are you sure you've selected "Front Page Banner Image Cropper" and not the default "Image Cropper" datatype?  I know that exception can be caused if you don't have any crops defined, which maybe you don't on the default Image Cropper datatype

    Otherwise, can you post the full exception?

    -Tom

  • Darryl Godden 145 posts 197 karma points
    Jun 22, 2012 @ 15:25
    Darryl Godden
    0

    Hi Tom,

    Thanks for your reply.

    I meant to add I'm trying to use this with a document type, which I believe is possible - unless you tell me different?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 22, 2012 @ 15:41
    Tom Fulton
    0

    Yes, I think that is possible (not positive though).

    So, can you confirm on your document type you've referenced your custom cropper (Front Page Banner Image Cropper) instead of hte default one (Image Cropper)?

    Also, do you have an upload field called umbracoFile on your Document Type?

    If so can you also post the full exception?

    Thanks,
    Tom

  • Darryl Godden 145 posts 197 karma points
    Jun 22, 2012 @ 16:28
    Darryl Godden
    0

    Hi Tom,

    Yep referencing the control I've created and an upload, still no joy, here's the exception:

    [NullReferenceException: Object reference not set to an instance of an object.]
       umbraco.editorControls.imagecropper.DataEditor.OnInit(EventArgs e) +671
       System.Web.UI.Control.InitRecursive(Control namingContainer) +140
       System.Web.UI.Control.InitRecursive(Control namingContainer) +311
       System.Web.UI.Control.InitRecursive(Control namingContainer) +311
       System.Web.UI.Control.InitRecursive(Control namingContainer) +311
       System.Web.UI.Control.InitRecursive(Control namingContainer) +311
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +197
       System.Web.UI.ControlCollection.Add(Control child) +79
       umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +3675
       umbraco.controls.ContentControl.CreateChildControls() +629
       System.Web.UI.Control.EnsureChildControls() +102
       umbraco.controls.ContentControl.OnInit(EventArgs e) +32
       System.Web.UI.Control.InitRecursive(Control namingContainer) +140
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +197
       System.Web.UI.ControlCollection.Add(Control child) +79
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +1249
       System.Web.UI.Control.InitRecursive(Control namingContainer) +140
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480

    Here's my document type set-up:

    Any ideas?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 22, 2012 @ 16:30
    Tom Fulton
    1

    Yep, think you might have a small typo :)

    Your screenshot shows the property on your datatype is called "uploadFile" but in the Image Cropper you have it configured as "umbracoFile" - I would try renaming the property on your doctype to "umbracoFile"

    -Tom

  • Darryl Godden 145 posts 197 karma points
    Jun 22, 2012 @ 16:34
    Darryl Godden
    0

    D'oh! Dammit, dammit, dammit!

    Well spotted, much kudos to you sir!

Please Sign in or register to post replies

Write your reply to:

Draft