Active topicshttp://our.umbraco.orgumbracoLatests topics from the forum on our.umbraco.orgenCan't see created folders and uploaded images http://our.umbraco.org/forum/ourumb-dev-forum/bugs/41263-Cant-see-created-folders-and-uploaded-images-Fri, 24 May 2013 19:23:08 GMThttp://our.umbraco.org/forum/ourumb-dev-forum/bugs/41263-Cant-see-created-folders-and-uploaded-images-I created a series of folders and uploaded a bunch of stuff into umbraco.  I didn't do anything else.  A few hours later I log back in and a bunch of those folders with the images are not appearing in the umbarco interface.  I checked the physical media folder and it appears that the uploaded content is there, but umbraco backend doesn't see it. .

Anyone have any thoughts on how to fix this?

]]>
v6.0.5 SqlCe - A duplicate value cannot be inserted into a unique indexhttp://our.umbraco.org/projects/developer-tools/usync/usync/41260-v605-SqlCe-A-duplicate-value-cannot-be-inserted-into-a-unique-indexFri, 24 May 2013 16:29:48 GMThttp://our.umbraco.org/projects/developer-tools/usync/usync/41260-v605-SqlCe-A-duplicate-value-cannot-be-inserted-into-a-unique-indexIt's the first time that I've tried uSync, so this is one of those - "I'm not sure if it's me, or I've found a bug" moments.

For testing it out, I've got a fresh Umbraco 6.0.5 (using SQL CE), with the Standard Website MVC starter kit installed (no other packages installed).

Then I installed "uSync_1.3.2_Umbraco6.zip" ... which then threw a YSoD.

Server Error in '/' Application.

A duplicate value cannot be inserted into a unique index. [ Table name = cmsDocumentType,Constraint name = PK_cmsDocumentType ]

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.Data.SqlServerCe.SqlCeException: A duplicate value cannot be inserted into a unique index. [ Table name = cmsDocumentType,Constraint name = PK_cmsDocumentType ]

Source Error: 


Line 1359:				throw;
Line 1360:			}
Line 1361:		}
Line 1362:
Line 1363:		// Insert an annotated poco object

Source File: c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\PetaPoco.cs    Line: 1361 

Stack Trace: 


[SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = cmsDocumentType,Constraint name = PK_cmsDocumentType ]]
   System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr) +269
   System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor) +670
   System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) +474
   System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() +44
   Umbraco.Core.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\PetaPoco.cs:1361
   Umbraco.Core.Persistence.Database.Insert(Object poco) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\PetaPoco.cs:1367
   Umbraco.Core.Persistence.Repositories.ContentTypeRepository.PersistUpdatedItem(IContentType entity) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\Repositories\ContentTypeRepository.cs:254
   Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistUpdatedItem(IEntity entity) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\Repositories\RepositoryBase.cs:206
   Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit() in c:\VCS\Umbraco\Core\src\Umbraco.Core\Persistence\UnitOfWork\PetaPocoUnitOfWork.cs:109
   Umbraco.Core.Services.ContentTypeService.Save(IEnumerable`1 contentTypes, Int32 userId) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Services\ContentTypeService.cs:164
   Umbraco.Core.Services.PackagingService.ImportContentTypes(XElement element, Boolean importStructure, Int32 userId) in c:\VCS\Umbraco\Core\src\Umbraco.Core\Services\PackagingService.cs:240
   umbraco.cms.businesslogic.packager.Installer.ImportDocumentType(XmlNode n, User u, Boolean ImportStructure) in c:\VCS\Umbraco\Core\src\umbraco.cms\businesslogic\Packager\Installer.cs:939
   jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path, Boolean structure) in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\SyncDocType.cs:157
   jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path, Boolean structure) in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\SyncDocType.cs:164
   jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path, Boolean structure) in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\SyncDocType.cs:164
   jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path, Boolean structure) in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\SyncDocType.cs:164
   jumps.umbraco.usync.SyncDocType.ReadAllFromDisk() in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\SyncDocType.cs:123
   jumps.umbraco.usync.uSync.ReadAllFromDisk() in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\uSync.cs:164
   jumps.umbraco.usync.uSync.RunSync() in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\uSync.cs:243
   jumps.umbraco.usync.uSync.DoOnStart() in c:\VCS\Umbraco\Community\Collaboration\uSync\jumps.umbraco.usync\uSync.cs:71
   Umbraco.Core.CoreBootManager.<Complete>b__5(IApplicationEventHandler x) in c:\VCS\Umbraco\Core\src\Umbraco.Core\CoreBootManager.cs:153
   Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable`1 items, Action`1 action) in c:\VCS\Umbraco\Core\src\Umbraco.Core\EnumerableExtensions.cs:91
   Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) in c:\VCS\Umbraco\Core\src\Umbraco.Core\CoreBootManager.cs:152
   Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) in c:\VCS\Umbraco\Core\src\Umbraco.Web\WebBootManager.cs:110
   Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) in c:\VCS\Umbraco\Core\src\Umbraco.Core\UmbracoApplicationBase.cs:35
   Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) in c:\VCS\Umbraco\Core\src\Umbraco.Core\UmbracoApplicationBase.cs:48

[HttpException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = cmsDocumentType,Constraint name = PK_cmsDocumentType ]]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12863325
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = cmsDocumentType,Constraint name = PK_cmsDocumentType ]]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257

(I tried to debug it - downloaded the uSync source and put in the Umbraco core PDB files - that's why the filepaths are different)

From debugging uSync, the problem happens at `SyncDocType.cs` line 157:

Installer.ImportDocumentType(node, User.GetUser(0), structure);

Following it through to the Umbraco core, it seems to fall over when trying to insert the "Allowed Templates" for the "Standard" doc-type.

 

My gut feeling is that this is an Umbraco core bug - along the lines of U4-2112.

... that is, unless I'm missing something obvious?

Thanks, Lee.

]]>
Company Blog error in Business starter kithttp://our.umbraco.org/forum/templating/templates-and-document-types/41262-Company-Blog-error-in-Business-starter-kitFri, 24 May 2013 19:12:54 GMThttp://our.umbraco.org/forum/templating/templates-and-document-types/41262-Company-Blog-error-in-Business-starter-kitYesterday, I installed Umbraco from the Windows Azure templates, version 6.x.  When I clicked on the "Company Blog" section in the nav bar then clicked on the "Company Blog Post" link I got this error.

-------------------------

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

------------------------

Since this in in the Windows Azure cloud, I don't think I can run this from the local server machine and I don't know how to modify the web.config file so that it will show me the error.

I am using the business starter kit in an attempt to sell Umbraco to the company mangement and the first thing we try to do results in an error.  I was really counting on the fact that the starter kits would all work.

Can anyone help me identify and then correct the error in the starter kit? 

]]>
Not Found Handler in 4.11.8http://our.umbraco.org/forum/developers/api-questions/41220-Not-Found-Handler-in-4118Thu, 23 May 2013 16:25:22 GMThttp://our.umbraco.org/forum/developers/api-questions/41220-Not-Found-Handler-in-4118I've upgraded from 4.7.2 to 4.11.8 and have found that my not found handler is no longer working (nor firing). I've checked that my handler is in the 404handlers.config. 

Here is my code:

public class PageNotFoundHandler : INotFoundHandler   
    {
        private int RedirectNodeId;
        
        public bool Execute(string url)
        {
            string CurrentDomain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
            int DomainRoot = Domain.GetRootFromDomain(CurrentDomain);
            Node HomePage = new Node(DomainRoot);
           
            RedirectNodeId = HomePage.GetPropertyInt(PropertyNames.ERROR_PAGE);

            if (RedirectNodeId == -1)
            {
                RedirectNodeId = HomePage.Id;
            }
            return true;
        }

        public bool CacheUrl
        {
            get { return true; }
        }

        public int redirectID
        {
            get { return RedirectNodeId; }
        }
    }
]]>
ReturnURL returns no result to payment providerhttp://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/41261-ReturnURL-returns-no-result-to-payment-providerFri, 24 May 2013 18:00:18 GMThttp://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/41261-ReturnURL-returns-no-result-to-payment-providerHi,

I am using TeaCommerce 1.4.3.1 on IIS6 with SagePay as the payment provider and ever since monday (21st) whenever SagePay post back to say that payment has been successful it fails because there is nothing on the page. I have been to the page that SagePay say they are posting to:

http://www.myshop.com/tcbase/teacommerce/PaymentCallback/SagePay/E5AE697CE5A0BFDC8A5FCD2AB5D7DB3B.aspx

and there is literally nothing on the page and this is causing a problem for SagePay as they aren't receiving acknowledgement that the message has been received.

Does anyone why this would be happening? As far as i know, nothing has been changed on this site since it was last working (monday 21st). 

Where is the /tcbase/ directory in the umbraco filestructure?

What should it be returning to sagepay?

Thanks for your help.

Chris

 

]]>
VAT doubling up in version 311http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/41160-VAT-doubling-up-in-version-311Wed, 22 May 2013 12:11:13 GMThttp://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/41160-VAT-doubling-up-in-version-311ImageGen and cachinghttp://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/41005-ImageGen-and-cachingFri, 17 May 2013 11:46:52 GMThttp://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/41005-ImageGen-and-cachingHi,

This question is sort of connected to this question: http://our.umbraco.org/forum/core/general/40756-Weird-caching-problems-with-images

So, I'm working on this website which fetches quite a few images with ImageGen.

 

However, the site tends to get slower and slower over time. I've noticed, that this one:

http://en.r82.testweb.designit.com/ImageGen.ashx?image=/pimmedia/image/Crocodile_Hand%20brakes_86834_48281.jpg&width=236&height=236

... loads slower, than this one:

http://en.r82.testweb.designit.com/pimmedia/image/Crocodile_Hand%20brakes_86834_48281.jpg

 

I'm wondering, if ImageGen doesn't use the cached images and generates them each and every time, and therefore gets slower?. And what could be the solution to this?

 

Br,
Dan

]]>
Support for custom Media Typeshttp://our.umbraco.org/projects/website-utilities/multiple-file-upload/bugs/20286-Support-for-custom-Media-TypesThu, 12 May 2011 18:32:49 GMThttp://our.umbraco.org/projects/website-utilities/multiple-file-upload/bugs/20286-Support-for-custom-Media-TypesHello,

I've modified the source code of the project to support custom Media Types:

If anyone is interested just let me know and I will share the code. It could also be part MFU by default if I can upgrade it. I also fixed some other bugs.

Jeroen 

]]>
Unable to install starterkithttp://our.umbraco.org/forum/getting-started/installing-umbraco/41229-Unable-to-install-starterkitThu, 23 May 2013 21:31:38 GMThttp://our.umbraco.org/forum/getting-started/installing-umbraco/41229-Unable-to-install-starterkitArchitectural questions for building a system on top of Umbraco, using Razorhttp://our.umbraco.org/forum/developers/extending-umbraco/41140-Architectural-questions-for-building-a-system-on-top-of-Umbraco,-using-RazorTue, 21 May 2013 23:20:11 GMThttp://our.umbraco.org/forum/developers/extending-umbraco/41140-Architectural-questions-for-building-a-system-on-top-of-Umbraco,-using-Razor

Hello,

I would like to build a platform with various tools and add-ons on top of Umbraco.  The vision is that I would have Umbraco installed at various locations, who could in turn install various plug-ins and packages that would provide additional functionality while leveraging the benefits of Umbraco such as the CMS, security, blogging, and other features.  Each of the plug-ins/ packages I would provide would pull their data from a back end system that I would support.  I am planning on creating a set of WCF Services for each of these plug-ins which would allow for saving and retrieval to the back end system.

I would like to create these plug-ins/packages using Umbraco 6 to take advantage of the MVC Razor support.  My thought is that if I use Razor, an administrator might be able to change the cshtml files to fit custom scenarios without impacting future builds, customizing the view for a particular need (i.e. in one instance a control may need to be rendered as a table, in another it may need to be rendered as a set of div tags, etc).

I am, however, running into a bit of a stumbling block on deciding how to architect everything.

For the purpose of this example, I would like to work on creating a plug-in/package that would be a simplified News service (I know, there is already a News package in Umbraco, but I need a simple example).  I would need to have three or four controls.

1.      News Player – A control that is able to show 4-5 news items, and cycle through them using a pager.

2.      News Grid – A grid that shows all of the News Items, with the ability to page through past News Items and sort the Grid.

3.      News Administration – A control that allows an Administrator to enter new News Items, delete old News Items, etc.

4.      Configuration – A control for the Umbraco Backoffice which will allow me to set up the WCF configuration in the web.config to talk to the back-end system.

I believe I will create the Configuration Control using a traditional ASP.NET User Control for ease of use and simplicity.  Everything else, I figure I will create via MVC and Razor scripting.

I would like to be able to pass parameters into the News Player and News Grid controls.  These would be for things like, when rendering the News Player providing a link to where in the site the News Grid is located.  This way the News Player can have a link to the News Grid, and when the user is viewing the player, they can click a link to get to the Grid.  In addition, the News Grid and News Player should be passed a parameter on where the Administration page is located, so if the user has rights to view the Administration page they will have an option to click a link to get there.  In my mind, these controls will need to be Macros so we can pass a ContentPicker parameter, and the view would then use Umbraco’s code base to create a link to the other node, check security, etc.

As I have been working on this, I am stuck at a cross roads at how to architect this.

From what I understand, I can create my Surface Controllers one of two ways.

1.      Standard Surface Controller

If I create this as a standard Surface Controller, I would create the DLL, install it in the Bin folder, and create all of the Views (cshtml) via Umbraco’s interface.  It would allow me to have the Views be somewhere that an Administrator could alter them.  This way if they needed to change the grid from a table layout to a div layout, it could be done.

I have tested, this, and it seems to work.  I have the following code:

Controller:

    public class NewsSurfaceController : SurfaceController
    {
        public ActionResult Index()
        {
            return Content("hello world");
        }
 
        [ChildActionOnly]
        public ActionResult NewsPlayer()
        {
            return PartialView("NewsPlayer", new Models.NewsItem(0, "Hello from NEAT News"));
        }
    }

Model:

public class NewsItem
{
#region Constructor
public NewsItem(int newsItemID, string title)
{
this.NewsItemID = newsItemID;
this.Title = title;
}
#endregion
#region Public Properties
public int NewsItemID { get; set; }
public string Title { get; set; }
#endregion
}

View (under Partial View Macro Files):

@inherits Umbraco.Web.Mvc.UmbracoViewPage<Centeva.GovAP.Plugins.News.Controls.Umbraco.Models.NewsItem>
The name specified is here:
<br />
<strong>@Model.Title</strong>

Template:

@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@Html.Action("NewsPlayer", "NewsSurface")

Everything works well.

However, when I try to turn it into a Macro and use the Macro in the template:

@Umbraco.RenderMacro("NewsPlayer", new {})

I generate an error:

Error loading Partial View script (file: ~/Views/MacroPartials/NewsPlayer.cshtml)

I believe it doesn’t like the Model that was passed in, it is as if it is by-passing the controller.

2.      Plug-in Surface Controller

The other way to do this is to create a Plug-In Surface Controller.  To do this, I simply add an attribute to the controller:

[PluginController("GovAP")]

Next I place the views in the appropriate area of the Umbraco site:

App_Plugin/<Area>/Views/<Controller>

The View seems much the same.

When calling the code from the Template, it would look something like this:

@Html.Action("NewsPlayer", "NewsSurface", new {area = "GovAP" })

This works fine.

The problem I see is that if I use the Plug-in approach, I don’t see an easy way to pass in variables via Macros.  I would like the user experience from Umbraco’s back office to be able to add a component, and simply have it pull up a drop down of all of the nodes in the site and select the node that has the Admin features for the control, or the Grid version of the control, etc.  With the Plug-in, I can’t see the ability to do this.

With the non-plugin approach, you can create a Package of all of the macro’s, scripts, etc.  That is great.  However, it seems that I am unable to actually create a macro, use the macro, or use parameters passed in with the Macro, with the view I create. Is this because I can not use a Custom Model with Macro’s?  What is the best way to set this up so an Administrator can use Umbraco to easily fill out these Parameters?

If I want the ability for the Admin to modify the views, am I best using Partial View Macro Files?  Would I be better off using a Plugin?

If I use Partial View Macro Files, can I use a Custom Model?  If not, what is the best way to gain access to my back end models?  Do I just make a call to my BLL using Razor, and access it that way?  If using a Custom Model, can I some how access Macro Parameters?  How is this best done?

If I am creating a package, is there any way I can privately deploy that package to my webserver, and have Umbraco check that server for an updated version?

 

]]>