ActiveTopics https://our.umbraco.org Wed, 10 Feb 2016 10:36:45 +00:00 umbraco Latests topics from the forum on our.umbraco.org en Changing form field mappings https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74957-changing-form-field-mappings https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74957-changing-form-field-mappings Umbraco forms using "Post form to URL" in the workflow.

Changing an existing field mapping does not work, can change either the Alias, Form value or Static value, and get the "Workflow saved" message when click update, but going back into the workflow nothing has changed.

Have to delete and then re-add a mapping to change it.

Have got Diplo Trace Log Viewer installed but there is no error shown for this.

Mike

]]>
Mike Beale Wed, 10 Feb 2016 10:05:00 +00:00
Bundled files in custom editors https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/74956-bundled-files-in-custom-editors https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/74956-bundled-files-in-custom-editors Is there a way to use MVC bundles in custom grid editors? What I need is to have one js file and one css file build from SCSS files and bunch of JS files that can be included among my custom editors. I do not want to include each and every file by itself in javascript section of a manifest file.

{
    gridEditors: [
        {
            // config
        }
    ],
    javascript: [
        // my controller
        // !!! single file containing other files bundled
    ],
    css: [ 
        // !!! single file containing other files bundled
    ]
}

My related post on StackOverflow

]]>
LP Wed, 10 Feb 2016 10:00:29 +00:00
Dictionary in TextBoxfor https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74955-dictionary-in-textboxfor https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74955-dictionary-in-textboxfor Hi,

Anyone know a way to localize a placeholder value in TextBoxFor?

I have this:

@Html.EditorFor(model => model.EmailAddress, new { placeholder = "My email address..." }) I want the text 'My email address...' to come form the dictionary tree.

]]>
Peter Cort Larsen Wed, 10 Feb 2016 09:49:20 +00:00
Orderlines missing/wrong quantity Klarna https://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/74953-orderlines-missingwrong-quantity-klarna https://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/74953-orderlines-missingwrong-quantity-klarna Im running Teacommerce (2.2.3.b2) on an Umbraco 6.1.6 with Klarna as payment provider. Most of the time it works, but some random orders orderlines are not saved to the Teacommerces database, BUT they are saved to Klarna (visible on Klarnas website). The total sum of the order is correct though (in the database also), but the orderlines sum is on Transaction fee and not Subtotal.

The only errors I find (in App_Data\Logs) is this (Teacommerce backend says this order was finished 2016-01-23 06:14).

> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Name'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Address'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'ZipCity'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Country'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Telephone'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Email'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Name'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Address'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'ZipCity'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Country'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
> 2016-01-23 06:14:53,452 [8] WARN 
> Umbraco.Web.Dictionary.DefaultCultureDictionary - [Thread 40] Error
> returning dictionary item 'Email'. Exception:
> System.NullReferenceException: Object reference not set to an instance
> of an object.    at
> Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)

Any idea what could be wrong?

What do you suggest I do? Upgrade Teacommerce? If yes, in what order? The licence is only for v2.x.x

]]>
Tobbe Wed, 10 Feb 2016 08:49:25 +00:00
Autogenerated templates do not compile https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74952-autogenerated-templates-do-not-compile https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74952-autogenerated-templates-do-not-compile Autogenerated doctype templates do not compile in the visual studio editor. I created the templates in Umbraco version 7.4.0-RC1, and the generated cshtml looks like this:

@using ContentModels = Umbraco.Web.PublishedContentModels;
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.Article>
@{
    Layout = null;
}

The error is

Severity Code Description Project File Line Error CS0234 The type or namespace name 'Article' does not exist in the namespace 'Umbraco.Web.PublishedContentModels' (are you missing an assembly reference?)

It seems the class ContentModels.Article cannot be found.

How do I get this to compile?

]]>
Thor Muto Asmund Wed, 10 Feb 2016 08:09:39 +00:00
Custom property https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74951-custom-property https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74951-custom-property Hi

How to create custom property editor and fetch current content page id?

Thanks

]]>
max Wed, 10 Feb 2016 04:41:37 +00:00
LINQ Sequence Error When Attempting Translation with Polyglot https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74950-linq-sequence-error-when-attempting-translation-with-polyglot https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74950-linq-sequence-error-when-attempting-translation-with-polyglot When I attempt to create a translation with Polyglot in the context menu that appears when right clicking content nodes, I get this error:

System.InvalidOperationException: Sequence contains more than one element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
   at Umbraco.Core.Persistence.Database.SingleOrDefault[T](Sql sql)
   at Dimi.Polyglot.DAL.ContentType.GetPropertyList(Int32 contentTypeId, List`1 rowList)
   at Dimi.Polyglot.BLL.ContentType.GetPropertyList(Int32 contentTypeId)
   at Dimi.Polyglot.BLL.DocumentTranslation.<>c__DisplayClass11_0.<CheckTranslationInfrastructure>b__1(PropertyType p)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at Dimi.Polyglot.BLL.DocumentTranslation.CheckTranslationInfrastructure(Int32 nodeID)

I'm using Umbraco 7.3.4 and Polyglot 2.04.

]]>
Nicholas Westby Wed, 10 Feb 2016 02:38:02 +00:00
Polyglot Doesn't Work with Compositions? https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74949-polyglot-doesnt-work-with-compositions https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74949-polyglot-doesnt-work-with-compositions I'm using Polyglot 2.04 with Umbraco 7.3.4 and I may have come across a bug having to do with compositions.

If I create a composition that contains the "Language" property (of type label) and compose my translation doctype from that composition, I get an error when I attempt to create translations from the context menu when right clicking a content node:

 2016-02-09 18:22:52,135 [P5260/D43/T9] ERROR Dimi.Polyglot.BLL.DocumentTranslation - Translation document type does not contain the 'language' (alias) property
System.Exception: Translation document type does not contain the 'language' (alias) property
   at Dimi.Polyglot.BLL.DocumentTranslation.CheckTranslationInfrastructure(Int32 nodeID)

My guess is it's looking for the "language" property on the doctype in a way that isn't compatible with compositions.

]]>
Nicholas Westby Wed, 10 Feb 2016 02:33:52 +00:00
Security Fixes for 4.x https://our.umbraco.org/forum/marketing-sales/general-marketing-sales-discussion/74948-security-fixes-for-4x https://our.umbraco.org/forum/marketing-sales/general-marketing-sales-discussion/74948-security-fixes-for-4x Hi,

How long does umbraco intent to continue releasing security updates for umbraco 4.x ?

If the answer is vague, or the answer is we don't know that's fine, at least it's an answer.

Cheers.
Murray.

]]>
Murray Roke Wed, 10 Feb 2016 00:05:14 +00:00
Responsive Preview on specific date https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74947-responsive-preview-on-specific-date https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74947-responsive-preview-on-specific-date Hello,

I have been searching the webs and forums but can't seem to find an answer to this. I assume it is not supported but is there a way to use responsive preview to look at content that will be live on a specific date? For example, I have a homepage that loads promo modules and we have publishing windows set up so that when a campaign ends, the promo is unpublished and either evergreen content or a new campaign is published.

Is there any way to see a preview of what the page would look like 10 days from now when the current campaign is over?

Thanks in advance, will

]]>
Will Chamberlin Tue, 09 Feb 2016 23:32:13 +00:00
Paste HTML into a plain text field? https://our.umbraco.org/forum/using/ui-questions/74946-paste-html-into-a-plain-text-field https://our.umbraco.org/forum/using/ui-questions/74946-paste-html-into-a-plain-text-field Before I start to experiment and check the results I wanted to ask if anyone else has done something like this before.

We have a third party tool that generates a single HTML file that has a very large formatted form. I am wondering if I can take the HTML and copy it into an Umbraco page text field. I want Umbraco to provide some control of this content rather than just allowing staff to dump files into a folder.

Will the HTML render properly or will key portions be stripped out?

(Note: These are Answer Path files.)

]]>
Connie DeCinko Tue, 09 Feb 2016 21:02:32 +00:00
Courier: Custom Handler, Dependency, Resource https://our.umbraco.org/forum/umbraco-pro/courier/74945-courier-custom-handler-dependency-resource https://our.umbraco.org/forum/umbraco-pro/courier/74945-courier-custom-handler-dependency-resource I'm writing a custom handler for a datatype that stores references both to other nodes (by integer Node ID) and media object (also by integer Node ID), wrapped in some JSON with some other properties.

I have no trouble getting my handler to run and found it easy to just convert the int IDs into a GUID when packing and reverse that conversion when extracting. The question is, are media files supposed to be dependencies or resources?

The documentation really doesn't explain clearly what the difference is; so I've just been using item.Dependencies.Add(mediaGuid, ItemProviderIds.mediaItemProviderGuid); Is there any particular reason to use item.Resources at all? It seems to work correctly without any calls to item.Resources.Add(), but I don't know if that's just getting lucky or what.

Also, in debugging the code, I notice that

public override void PackagingProperty(Item item, ContentProperty propertyData) gets invoked 3 times with the exact same arguments (there's only one use of the particular data type on this page anyway, and I haven't chosen "include all nodes below this.").

I have two custom Providers, and when I put breakpoints on their PackagingProperty calls, I see

Foo.PackagingProperty()
Bar.PackagingProperty()
Foo.PackagingProperty()
Bar.PackagingProperty()
Foo.PackagingProperty()
Bar.PackagingProperty()

In all 6 cases, Item is the same, and across the three Foo's the propertyData is the same, likewise the 3 Bar's all match on their propertyData.

During extraction, each ExtractingProperty() is called only once. Foo, then Bar. Again, this all seems to work, but I'm trying to diagnose a problem where Courier sometimes creates a duplicate copy of the node I'm trying to transfer, which then breaks all subsequent transfers. Seemed like my custom handlers were a good place to start, but I don't see anything overtly wrong with them. Is there any explanation for why Courier invokes PackagingProperty() three times per property?

]]>
Carl Bussema Tue, 09 Feb 2016 19:25:19 +00:00
Membership - Non unique username https://our.umbraco.org/forum/developers/api-questions/74944-membership-non-unique-username https://our.umbraco.org/forum/developers/api-questions/74944-membership-non-unique-username My client has requested that we allow users to create multiple user accounts with the same email address, the difference between then would be the role their assigned during registration (Role 1 or Role 2)

I've changed the registration code to assign them to the selected role ok.

I've changed the login method to detect the role and find the correct member from the database but:

  • The issue begins if the user has used the same username (Email address) and password for both Roles.
  • When setting the FormsAuthentication.SetCookie(username, true), and then redirecting to the profile page, I use this code to lookup the current member:

    public static NetworkFreelanceMember GetCurrentNetworkFreelanceMember(this MembershipHelper helper) { if (!helper.IsLoggedIn()) { return null; }

        var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
        var member = umbracoHelper.TypedMember(helper.GetCurrentMember().Id);
    
        return GetInternalNetworkFreelanceMember(member);
    }
    

It appears the internal Umbraco code is looking up the Current Logged In Member, but by username only and only finding the first member that matches the username (email address).

Do I need to change the way the SetCookie is created, passing in the Role perhaps ?

Is there a better way of using helper.GetCurrentMember() ?

]]>
ianhoughton Tue, 09 Feb 2016 18:54:17 +00:00
Examine won't reindex my media https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74943-examine-wont-reindex-my-media https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74943-examine-wont-reindex-my-media We are having an issue on our production site with examine and its indexing. If we delete the Examine indexes in the /App_Data/TEMP folder, our media lookups on the front end will return empty. Rebuilding the indexes in the developer section of the back office does NOT fix this either. The only way to fix this is by going and saving each individual media item one by one. Surely there has to be a better solution than this? Does anyone have any ideas why examine would not be rebuilding these indexes on rebuild?

]]>
Logan P. Tue, 09 Feb 2016 18:48:50 +00:00
Two Separate Authentication Modes? https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74942-two-separate-authentication-modes https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74942-two-separate-authentication-modes Is there a way to have two separate authentication methods - one for members and one for back office users?

Member would be authenticated using basic forms authentication and back office users would be through ASP.Net Identity Google OAuth2 authentication. I have looked at a couple posts about this but they all are mostly about when both types of members use Google OAuth.

Are there any good tutorials or sample code out there for implementing this type of two-way authentication?

Thanks in advance.

]]>
Adam Zimmer Tue, 09 Feb 2016 17:45:36 +00:00
CodeGarden 16 Details https://our.umbraco.org/forum/meetups-and-usergroups/suggest-a-meetup/74941-codegarden-16-details https://our.umbraco.org/forum/meetups-and-usergroups/suggest-a-meetup/74941-codegarden-16-details Doing some planning and want to know some more details for CodeGarden 16. I know when (June 15-17th 2016) and the general where (Odense, Denmark). Is there a specific venue yet, any hotel suggests?

]]>
Jason Tue, 09 Feb 2016 16:47:07 +00:00
Cannot render a macro when there is no current PublishedContentRequest (Custom Controller/Model) https://our.umbraco.org/forum/developers/extending-umbraco/74940-cannot-render-a-macro-when-there-is-no-current-publishedcontentrequest-custom-controllermodel https://our.umbraco.org/forum/developers/extending-umbraco/74940-cannot-render-a-macro-when-there-is-no-current-publishedcontentrequest-custom-controllermodel Hi,

I'm sure this is a familiar issue - I've found threads with the same problem, but unfortunately not fix it for me.

I'm also aware I can use [EnsurePublishedContentRequest(Id)], but unfortunately that solution also isn't available to me here.

As a quick overview, I'm using Umbraco as the 'Core' of my website, where some pages are dynamically generated via an API.

On an API generated page, I need to ability to add macros which is causing the above error. Any help would be very appreciated, it may well even be something very obvious that I've missed!

Controller:

public class ApiPageController : RenderMvcController
{
    public ActionResult Item(RenderModel model, string apiId)
    {
        // connect to the API and get the item page
        var api = new ApiConnection();
        var apiResult = api.getPage(apiId);

        UmbracoHelper UH = new UmbracoHelper(UmbracoContext.Current);
        var UmbracoApiPage = UH.TypedContentAtRoot()
            .DescendantsOrSelf("ApiContent")
                .Where(pc => pc.GetPropertyValue("apiId") != null)
                .FirstOrDefault();

        var vm = new ApiViewModel(UmbracoApiPage, CultureInfo.CurrentUICulture);

        // RouteData.DataTokens["umbraco"] = vm;
        // RouteData.DataTokens["umbraco-doc-request"] = UmbracoContext.Current.PublishedContentRequest;
        // RouteData.DataTokens["umbraco-context"] = UmbracoContext.Current;

        // assign the page to the View Model
        vm.apiPage = apiResult;

        return View(vm);
    }
}

Model:

public class ApiViewModel : RenderModel
{   
    // Not used, left in as a fallback
    public ApiViewModel() : this(new UmbracoHelper(UmbracoContext.Current)) { }

    // Not used, left in as a fallback
    public ApiViewModel(UmbracoHelper Umbraco)
        : this(Umbraco.TypedContentAtRoot().FirstOrDefault(), CultureInfo.CurrentUICulture)
    {
    }

    public ApiViewModel(IPublishedContent content, CultureInfo culture)
        : base(content, culture)
    {
        // Dummy constructor
    }

    public ApiPageResult ApiPage { get; set; }
}

If believe that's the code you need to see, but let me know if you need snippets of the View :)

Thanks,

Daniel

]]>
Daniel Tue, 09 Feb 2016 16:07:56 +00:00
I know some MVC + razor what next? https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74939-i-know-some-mvc-plus-razor-what-next https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74939-i-know-some-mvc-plus-razor-what-next I have got familiar with ASP>NET MVC and Razor (soem :)). What next ?

  • SQL
  • WEb APi
  • Signair
  • Etntity framework
  • or? What

I'm learnig c# all the time .. :)

]]>
wad Tue, 09 Feb 2016 16:06:14 +00:00
v4: After upgrading to v6 - empty properties are no longer in the XML-file https://our.umbraco.org/forum/using/migrating-from-v5-to-v4-and-beyond/74938-v4-after-the-upgrade-empty-properties-are-no-longer-in-the-xml-file https://our.umbraco.org/forum/using/migrating-from-v5-to-v4-and-beyond/74938-v4-after-the-upgrade-empty-properties-are-no-longer-in-the-xml-file I have upgrade a site from 4.11.10 to 6.2.5

After the Upgrade empty properties are no longer in the XML-file (umbraco.config)

v4.11.10

  <boxItem id="19235" parentID="15636" level="3" writerID="164" creatorID="0" nodeType="15408" template="-1" sortOrder="0" createDate="2013-04-24T13:12:06" updateDate="2014-09-10T10:20:42" nodeName="Weekend og feriekurser" urlName="weekend-og-feriekurser" writerName="Snebjørn Andersen (Admin)" creatorName="Henrik Bro (Admin)" path="-1,10266,15636,19235" isDoc="">
    <boxHeadline>Weekend og feriekurser</boxHeadline>
    <boxText><![CDATA[]]></boxText>
    <boxImage><![CDATA[]]></boxImage>
    <boxLink>
      <url-picker mode="URL">
        <new-window>False</new-window>
        <node-id />
        <url>/weekend-og-feriekurser/</url>
        <link-title />
      </url-picker>
    </boxLink>
    <boxHeaderPosition><![CDATA[]]></boxHeaderPosition>
    <boxTextFloat><![CDATA[]]></boxTextFloat>
    <boxImageHeight />
    <boxImageWidth />
  </boxItem>

v6.2.5

  <boxItem id="19236" parentID="15636" level="3" creatorID="0" sortOrder="3" createDate="2013-04-24T13:12:27" updateDate="2016-02-04T09:23:26" nodeName="Foredrag, samvær og debat" urlName="foredrag-samvaer-og-debat" path="-1,10266,15636,19236" isDoc="" nodeType="15408" creatorName="Henrik Bro (Admin)" writerName="Henrik Bro (Admin)" writerID="0" template="0" nodeTypeAlias="boxItem">
    <boxHeadline>Seniorskolen, samvær og debat</boxHeadline>
    <boxLink>
      <url-picker mode="URL">
        <new-window>False</new-window>
        <node-id />
        <url>/foredrag,-samvaer-og-debat/</url>
        <link-title />
      </url-picker>
    </boxLink>
    <boxHeaderPosition><![CDATA[Over]]></boxHeaderPosition>
  </boxItem>

The "boxHeaderPosition" was created after the upgrade when I choosed the value "Over".

Is it posibe to re-create the properties?

Best regards, Henrik

]]>
Henrik Bro Tue, 09 Feb 2016 15:23:44 +00:00
IPublishedContent Property Access https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74935-ipublishedcontent-property-access https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74935-ipublishedcontent-property-access Hi there,

We're working on update our site from 6.2.4 version to 7.3.7

We've tried to retrieve and show a property of a IPublishedContent object. Unfortunatly, GetPropertyValue method returns nothing (empty string or null).

Here is how we trying to use it:

// This line returns valid array (in our case it contains just one item, but can more)
var newsItems = Model.Content.Descendants("NewsItem").Where(ni => !ni.GetPropertyValue<bool>("hideOnNewsPage")).OrderByDescending(ni => ni.GetPropertyValue<string>("newsEntryDate")).ToList();

@foreach (var newsItem in newsItems)
            {
                var link = newsItem.GetPropertyValue<string>("newsEntryExternalLink");
                counter++;
                <div class="col-sm-6" style="@(counter % 2 == 0 ? "clear:right;" : "clear:left;")">
//Next two lines return "True", so we can know that a property really exist
                    <span>@newsItem.HasProperty("newsEntryDate").ToString()</span>
                     <span>@newsItem.HasValue("newsEntryDate").ToString()</span>
//Next line returns "False", so it means that a value exist
                     <span>@newsItem.IsNull("newsEntryDate").ToString()</span>

                    <div class="content-box icon-top-aligned-text">
                        <div class="press-release-icon">
//Next line represents just empty <em></em> element on the HTML page. Same for all other usages of GetPropertyValue method                      <em>@{newsItem.GetPropertyValue("newsEntryDate").ToString();}</em>                                  
                        </div>
                    </div>
                </div>
            }

NOTE: HasProperty and HasValue mehods return "True" value, so we'd expect that it will return something else than empty string.

Also we've tried to use "newsItem.newsEntryDate", however it throws an exception that the Property is undefined.

]]>
Aleksey Gerasimov Tue, 09 Feb 2016 14:46:52 +00:00
UMBRACO LOSE LANGUAGES/DICTIONARY https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74930-umbraco-lose-languagesdictionary https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74930-umbraco-lose-languagesdictionary Hi,

I'm getting problems with umbraco dictionary. In local, everything goes ok. But in PRE/SERVER we have problems with Lost languages.

For example, we have 10 languages added and Dictionary... and from nothing we just have 3 languages. We need to clear all the folders of cache APP_DATA to restart everything.

]]>
nuno Tue, 09 Feb 2016 11:43:56 +00:00
Application shutdown - various reasons https://our.umbraco.org/forum/ourumb-dev-forum/bugs/74929-application-shutdown-various-reasons https://our.umbraco.org/forum/ourumb-dev-forum/bugs/74929-application-shutdown-various-reasons Hi,

Looking through the Umbraco Trace Log I have noticed that the application keeps shutting down.

We are running Umbraco 7.2.8 on IIS 6.2 Windows Server 2012 R2.

We have installed hotfix KB320584 via a Windows update.

The reason is often BinDirChangeOrDirectoryRename, but there are others too, like ConfigurationChange.

Here is a sample from the log:

2016-02-09 08:48:41,612 [14] INFO  Umbraco.Core.PluginManager - [P9776/T42/D54] Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
2016-02-09 08:48:41,612 [14] INFO  Umbraco.Core.PluginManager - [P9776/T42/D54] Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 80 (took 2ms)
2016-02-09 08:48:41,862 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledPublishing] Terminating (immediate)
2016-02-09 08:48:41,862 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledPublishing] Cancelling tasks
2016-02-09 08:48:41,972 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledPublishing] Tasks cancelled, terminated
2016-02-09 08:48:41,972 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [KeepAlive] Terminating (immediate)
2016-02-09 08:48:41,972 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [KeepAlive] Cancelling tasks
2016-02-09 08:48:42,081 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [KeepAlive] Tasks cancelled, terminated
2016-02-09 08:48:42,097 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledTasks] Terminating (immediate)
2016-02-09 08:48:42,097 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledTasks] Cancelling tasks
2016-02-09 08:48:42,206 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [ScheduledTasks] Tasks cancelled, terminated
2016-02-09 08:48:42,206 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [LogScrubber] Terminating (immediate)
2016-02-09 08:48:42,206 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [LogScrubber] Cancelling tasks
2016-02-09 08:48:42,315 [102] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T142/D48] [LogScrubber] Tasks cancelled, terminated
2016-02-09 08:48:42,315 [102] INFO  Umbraco.Core.UmbracoApplicationBase - [P9776/T142/D48] Application shutdown. Reason: BinDirChangeOrDirectoryRename

And...

2016-02-09 08:18:13,390 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledPublishing] Terminating
2016-02-09 08:18:13,390 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledPublishing] Waiting for tasks to complete
2016-02-09 08:18:13,390 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledPublishing] Tasks completed, terminated
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [KeepAlive] Terminating
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [KeepAlive] Waiting for tasks to complete
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledTasks] Terminating
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledTasks] Waiting for tasks to complete
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [LogScrubber] Terminating
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [LogScrubber] Waiting for tasks to complete
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [KeepAlive] Tasks completed, terminated
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [LogScrubber] Tasks completed, terminated
2016-02-09 08:18:17,046 [75] INFO  Umbraco.Web.Scheduling.BackgroundTaskRunner - [P9776/T73/D6] [ScheduledTasks] Tasks completed, terminated
2016-02-09 08:18:18,983 [10] INFO  Umbraco.Core.CoreBootManager - [P9776/T57/D8] Umbraco 7.2.8 application starting on WIN-...

Any ideas what might be causing this?

]]>
Dominic Tue, 09 Feb 2016 11:06:30 +00:00
Best practice for re-usable blocks https://our.umbraco.org/forum/developers/razor/74927-best-practice-for-re-usable-blocks https://our.umbraco.org/forum/developers/razor/74927-best-practice-for-re-usable-blocks Hi, I'm having some trouble desciding what's the best way to do the following, and I'm hoping someone could be of any assistence.

I have a App_Code\Helpers.cshtml that contains (ofcourse) some helper-functions.

For instance, a function that renders a list of blocks for a given list of content-items.

I came a cross of limitations.

  • I can't use things such as GetPropertyValue() on an IPublishedContent
  • I don't have access to @Html to use the .Raw() or .RenderPartial() functions.
  • I need to create an instance of the @UmbracoHelper in every function.
  • Because this file is compiled on runtime, a single change makes the first page-visit really slow when developing. Even the first page-visit within the backend takes quite some time after an edit.

Just to name a few.

I try to use PartialMacro's when possible, but I think the possible parameter for a PartialMacro are limited. I can't create a PartialMacro that accepts a List<DynamicPublishedContent> for instance. As far as I know.

What would be the best way to use these functions? Any suggestions?

]]>
Jeroen Oostwouder Tue, 09 Feb 2016 10:38:37 +00:00
making custom image properties searchable https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74925-making-custom-image-properties-searchable https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74925-making-custom-image-properties-searchable Is there a simple way to make cutom media properties searchable in the backoffice?

In the example below, i would like to be able to find photos by photographer and tags, but the media seach only searches the name as default...

enter image description here

]]>
Claushingebjerg Tue, 09 Feb 2016 09:22:43 +00:00
Problem upgrading Umbraco 7.1.4 to 7.2.2 https://our.umbraco.org/forum/getting-started/installing-umbraco/74921-problem-upgrading-umbraco-714-to-722 https://our.umbraco.org/forum/getting-started/installing-umbraco/74921-problem-upgrading-umbraco-714-to-722 I installed Archetype using NuGet, which upgraded my Umbraco 7.1.4 to 7.2.2.

When I launched Umbraco, it showed the installation screen normally.

I got stuck when it just shows this loading page for hours (http://localhost:7073/install/?redir=true&url=http%3a%2f%2flocalhost%3a7073%2fumbraco%2f#?redir=true&url=http:%2F%2Flocalhost:7073%2Fumbraco%2F) stuck on this loading screen

If I manually set appSettings/umbracoConfigurationStatus to 7.2.2, everything works fine except list view.

If I set it back to 7.1.4, I can't continue the installation.

How can I continue with the update?
(even with running queries manually if no other way)

Or please let me know if there is a better place to ask this question.

]]>
Aximili Tue, 09 Feb 2016 06:23:45 +00:00
Umbraco install page doesn't load, redirects to itself https://our.umbraco.org/forum/getting-started/installing-umbraco/74920-umbraco-install-page-doesnt-load-redirects-to-itself https://our.umbraco.org/forum/getting-started/installing-umbraco/74920-umbraco-install-page-doesnt-load-redirects-to-itself I recently successfully installed Umbraco to an SQL Server Express database instance. I accidentally deleted the local database after installation, and attempted to reinstall with the same connection string. However, instead of being taken to the same install page, it seems to redirect onto itself. The page that is shown is the "install in progress" page, but without any indicator of an install going on. The database is not updated either. The URL looks like the ff.:

http://localhost:18032/install/?redir=true&url=http%3a%2f%2flocalhost%3a18032%2f#?redir=true&url=http:%2F%2Flocalhost:18032%2F

Is there any way I can rectify this issue and get taken back to the standard install page? The database is completely blank at the moment.

I am installing Umbraco from Visual Studio 2015 and running it locally via IISExpress.

]]>
Miguel Arcilla Tue, 09 Feb 2016 06:15:05 +00:00
IProductContent - accessing variant properties throws KeyNotFoundException https://our.umbraco.org/projects/collaboration/merchello/merchello/74912-iproductcontent-accessing-variant-properties-throws-keynotfoundexception https://our.umbraco.org/projects/collaboration/merchello/merchello/74912-iproductcontent-accessing-variant-properties-throws-keynotfoundexception Hi. I'm exploring the latest Merchello (1.14.0) using the corresponding Bazaar installation on top of a blank Umbraco 7.3.7 instance. It's looking really cool :)

I'm trying to access the properties of variants from IProductContent. So I'm looking at the ProductContent view for the default Bazaar install that inherits from UmbracoViewPage<IProductContent>. From this I can easily access all the variants by using Model.ProductVariants. I can access things like Name etc. fine for each variant (which is typed as IProductContent).

However, if I try and access the properties of any of these variants then I get a KeyNotFoundException.

Example code in view:

foreach (var variant in Model.ProductVariants)
{
    <p>
        @variant.Name (@variant.Sku) @* works fine *@

        @variant.GetPropertyValue("image") @* throws KeyNotFound exception *@

        @variant.Properties.Count @* also throws KeyNotFound exception *@

    </p>
}

So any attempt to access the Properties collection of IProductContent throws when it's a variant.

Here's a fuller stack trace:

[KeyNotFoundException: The given key was not present in the dictionary.]
   System.Collections.Generic.Dictionary`2.get_Item(TKey key) +11770017
   Merchello.Web.Models.VirtualContent.ProductContentBase.GetProperty(String alias) +68
   Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent content, String alias) +8
   ASP._Page_App_Plugins_Merchello_Bazaar_Themes_Sandstone_3_Views_ProductContent_cshtml.Execute() in c:\Projects\Merchello\Merchello.Umbraco\App_Plugins\Merchello.Bazaar\Themes\Sandstone-3\Views\ProductContent.cshtml:40
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291

Is this a bug or am I accessing it wrongly?

]]>
Dan Diplo Mon, 08 Feb 2016 15:26:10 +00:00
Getting values from property https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74910-getting-values-from-property https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74910-getting-values-from-property Hi

I have created an property called year, that is a checkbox property. I use this in a list, so i have a lot of pages that have ex 2007, 2008 and so on marked.

Can i on some way print all pages that have specific 2008 checked in my templates

I need to list the pages from each year with the number check

Hope you all understand what i looking for

]]>
Klaus Bergh Mon, 08 Feb 2016 14:35:36 +00:00
Can't make JsonDropdownPicker give any output https://our.umbraco.org/projects/backoffice-extensions/nupickers/questionssuggestions/74908-cant-make-jsondropdownpicker-give-any-output https://our.umbraco.org/projects/backoffice-extensions/nupickers/questionssuggestions/74908-cant-make-jsondropdownpicker-give-any-output Just to play around and to learn the nuPickers I was toying around with these examples.

http://goessner.net/articles/JsonPath/index.html#e3

But I can't really get them to work. This gives me zero output:

$..book[?(@.isbn)]

But if I test it here (http://jsonpath.com) it works perfectly.

Am I doing something wrong or is there a logical explanation ? I'm using 'isbn' as key and 'title' as label.

]]>
Sebastian Dammark Mon, 08 Feb 2016 13:41:47 +00:00
Adding Default Product Options/values https://our.umbraco.org/projects/collaboration/merchello/merchello/74907-adding-default-product-optionsvalues https://our.umbraco.org/projects/collaboration/merchello/merchello/74907-adding-default-product-optionsvalues I am working on a store that sells shoes. Shoes come in standard sizes but in order to avoid the monotonous entry of the same shoe sizes for EVERY product I want to setup default options when a new product is created. For some reason this does not appear to be working:

protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
    ProductService.Created += ProductServiceCreated;
}

private void ProductServiceCreated(IProductService sender, Core.Events.NewEventArgs<IProduct> e)
{
    var productOptionCollection = new ProductOptionCollection();

    // Add default product option for shoe size
    var shoeSizeOption = new ProductOption("Size") { Required = true };

    // Add default product size options
    shoeSizeOption.Choices.Add(new ProductAttribute("UK2.5 | EU35.5 | US5", "UK25EU355US5"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK2 | EU35 | US4.5", "UK2EU35US45"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK3 | EU36 | US5.5", "UK3EU36US55"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK3.5 | EU36.5 | US6", "UK35EU365US6"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK4 | EU37 | US6.5", "UK4EU37US65"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK4.5 | EU37.5 | US7", "UK45EU375US7"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK5 | EU38 | US7.5", "UK5EU38US75"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK5.5 | EU38.5 | US8", "UK55EU385US8"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK6 | EU39 | US8.5", "UK6EU39US85"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK6.5 | EU39.5 | US9", "UK65EU395US9"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK7 | EU40 | US9.5", "UK7EU40US95"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK8 | EU41 | US10.5", "UK8EU41US105"));
    shoeSizeOption.Choices.Add(new ProductAttribute("UK9 | EU42 | US11.5", "UK9EU42US115"));

    // Add the shoe size option to the new product options collection
    productOptionCollection.Add(shoeSizeOption);

    // Set product options to the new product options collection 
    e.Entity.ProductOptions = productOptionCollection;

    // Save the product to persist the changes
    sender.Save(e.Entity);
} 

The UI loads and the This variant has options (like size or color) option remains unchecked and no product options are visible.

Is there another step required?

]]>
Simon Dingley Mon, 08 Feb 2016 13:10:25 +00:00
Email says its been sent but not received https://our.umbraco.org/projects/backoffice-extensions/newsletter-studio/comments/74903-email-says-its-been-sent-but-not-recieved https://our.umbraco.org/projects/backoffice-extensions/newsletter-studio/comments/74903-email-says-its-been-sent-but-not-recieved Loving this package but can't get the newsletter to send correctly:

Using Newsletter Studio 2.1.4 on Umbraco 7.3.1

SMTP Settings succeed when I test the connection. Sending out a test email says "Success: The test e-mail was sent to...." but no email is received.

See below Umbraco stack trace. Has anyone got any suggestions?

Thanks

Nath

System.Exception: Error indexing queue items,System.ArgumentException: Illegal characters in path. at System.IO.Path.GetFileName(String path) at Our.Umbraco.ezSearch.ezSearchBoostrapper.OnGatheringNodeData(Object sender, IndexingNodeDataEventArgs e) at UmbracoExamine.UmbracoContentIndexer.OnGatheringNodeData(IndexingNodeDataEventArgs e) at Examine.LuceneEngine.Providers.LuceneIndexer.GetDataToIndex(XElement node, String type) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessIndexQueueItem(IndexOperation op, IndexWriter writer) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessQueueItem(IndexOperation item, ICollection`1 indexedNodes, IndexWriter writer) at Examine.LuceneEngine.Providers.LuceneIndexer.ForceProcessQueueItems(Boolean block), IndexSet: ExternalIndexSet 2016-02-08 09:48:57,888 [P11416/D3/T98] INFO umbraco.content - Save Xml to file... 2016-02-08 09:48:57,919 [P11416/D3/T118] INFO umbraco.content - Saved Xml to file. 2016-02-08 09:48:58,185 [P11416/D3/T149] INFO Umbraco.Core.Sync.ApplicationUrlHelper - ApplicationUrl: http://westmidlandscombinedauthority.org.uk:80/umbraco (UmbracoModule request) 2016-02-08 09:48:59,292 [P11416/D3/T149] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.interfaces.IAction 2016-02-08 09:48:59,292 [P11416/D3/T149] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.interfaces.IAction, found 0 (took 1ms) 2016-02-08 09:49:00,135 [P11416/D3/T166] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor 2016-02-08 09:49:00,135 [P11416/D3/T166] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 0 (took 0ms) 2016-02-08 09:49:00,181 [P11416/D3/T166] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.cms.businesslogic.macro.IMacroEngine 2016-02-08 09:49:00,181 [P11416/D3/T166] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.cms.businesslogic.macro.IMacroEngine, found 0 (took 0ms) 2016-02-08 09:49:08,064 [P11416/D3/T143] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.interfaces.IApplication 2016-02-08 09:49:08,064 [P11416/D3/T143] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.interfaces.IApplication, found 0 (took 1ms) 2016-02-08 09:49:15,443 [P11416/D2/T166] INFO Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: ConfigurationChange

_shutDownMessage=CONFIG change HostingEnvironment initiated shutdown HostingEnvironment caused shutdown

shutDownStack= at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Environment.getStackTrace() at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal() at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace) at System.Web.HttpRuntime.OnConfigChange(String message) at System.Configuration.BaseConfigurationRecord.OnStreamChanged(String streamname) at System.Web.DirectoryMonitor.FireNotifications() at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledPublishing] Terminating 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledPublishing] Waiting for tasks to complete 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledTasks] Terminating 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledTasks] Waiting for tasks to complete 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [LogScrubber] Terminating 2016-02-08 09:49:27,471 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [LogScrubber] Waiting for tasks to complete 2016-02-08 09:49:27,486 [P11416/D3/T149] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledPublishing] Tasks completed, terminated 2016-02-08 09:49:27,486 [P11416/D3/T8] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [LogScrubber] Tasks completed, terminated 2016-02-08 09:49:27,486 [P11416/D3/T144] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [ScheduledTasks] Tasks completed, terminated 2016-02-08 09:49:27,486 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [KeepAlive] Terminating 2016-02-08 09:49:27,486 [P11416/D3/T7] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [KeepAlive] Waiting for tasks to complete 2016-02-08 09:49:27,486 [P11416/D3/T9] INFO Umbraco.Web.Scheduling.BackgroundTaskRunner - [KeepAlive] Tasks completed, terminated 2016-02-08 09:49:31,667 [P11416/D4/T1] INFO Umbraco.Core.CoreBootManager - Umbraco 7.3.1 application starting on CENSLWEBDMZ01 2016-02-08 09:49:31,683 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Determining hash of code files on disk 2016-02-08 09:49:31,699 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Hash determined (took 19ms) 2016-02-08 09:49:31,870 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.interfaces.IApplicationStartupHandler 2016-02-08 09:49:31,901 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.interfaces.IApplicationStartupHandler, found 0 (took 30ms) 2016-02-08 09:49:31,964 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter 2016-02-08 09:49:31,964 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter, found 0 (took 0ms) 2016-02-08 09:49:31,964 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyValueConverter 2016-02-08 09:49:31,964 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyValueConverter, found 0 (took 4ms) 2016-02-08 09:49:31,995 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Web.Mvc.SurfaceController 2016-02-08 09:49:31,995 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Web.Mvc.SurfaceController, found 0 (took 2ms) 2016-02-08 09:49:31,995 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Web.WebApi.UmbracoApiController 2016-02-08 09:49:32,011 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Web.WebApi.UmbracoApiController, found 0 (took 13ms) 2016-02-08 09:49:32,104 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.Media.IThumbnailProvider 2016-02-08 09:49:32,104 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.Media.IThumbnailProvider, found 0 (took 1ms) 2016-02-08 09:49:32,104 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.Media.IImageUrlProvider 2016-02-08 09:49:32,104 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.Media.IImageUrlProvider, found 0 (took 1ms) 2016-02-08 09:49:33,633 [P11416/D4/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True 2016-02-08 09:49:33,976 [P11416/D4/T8] INFO umbraco.BusinessLogic.Log - Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: The file 'C:\inetpub\wwwroot\WMCALive\macroscripts\NewsletterSubscribe.cshtml' already exists. at System.IO._Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost) at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite) at NewsletterStudio.Bootstrapping.FolderSynchronizer.DirectoryCopy(String sourceDirName, String destDirName, Boolean copySubDirs, Boolean overwriteFiles) at NewsletterStudio.Bootstrapping.FolderSynchronizer.Synchronize(String sourceFolder, String destinationFolder, Boolean copySubDirs, Boolean overwrite) 2016-02-08 09:49:34,054 [P11416/D4/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True 2016-02-08 09:49:34,054 [P11416/D4/T1] INFO Umbraco.Core.DatabaseContext - CanConnect = True 2016-02-08 09:49:34,070 [P11416/D4/T1] WARN Umbraco.Core.Sync.DatabaseServerMessenger - No last synced Id found, this generally means this is a new server/install. The server will rebuild its caches and indexes and then adjust it's last synced id to the latest found in the database and will start maintaining cache updates based on that id 2016-02-08 09:49:34,085 [P11416/D4/T1] INFO umbraco.content - Load Xml from file... 2016-02-08 09:49:34,085 [P11416/D4/T1] INFO umbraco.content - Loaded Xml from file. 2016-02-08 09:49:34,101 [P11416/D4/T1] INFO umbraco.content - Loading content from database... 2016-02-08 09:49:36,550 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor 2016-02-08 09:49:36,550 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 0 (took 3ms) 2016-02-08 09:49:37,611 [P11416/D4/T1] INFO Umbraco.Web.Cache.CacheRefresherEventHandler - Initializing Umbraco internal event handlers for cache refreshing 2016-02-08 09:49:37,611 [P11416/D4/T1] INFO Umbraco.Web.Search.ExamineEvents - Initializing Examine and binding to business logic events 2016-02-08 09:49:37,611 [P11416/D4/T1] INFO Umbraco.Web.Search.ExamineEvents - Adding examine event handlers for index providers: 3 2016-02-08 09:49:37,611 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.Persistence.Mappers.BaseMapper 2016-02-08 09:49:37,611 [P11416/D4/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.Persistence.Mappers.BaseMapper, found 0 (took 0ms) 2016-02-08 09:49:37,673 [P11416/D4/T1] INFO Umbraco.Core.CoreBootManager - Umbraco application startup complete (took 6207ms) 2016-02-08 09:49:37,923 [P11416/D4/T149] ERROR UmbracoExamine.DataServices.UmbracoLogService - Provider=ExternalIndexer, NodeId=-1 System.Exception: Error indexing queue items,System.ArgumentException: Illegal characters in path. at System.IO.Path.GetFileName(String path) at Our.Umbraco.ezSearch.ezSearchBoostrapper.OnGatheringNodeData(Object sender, IndexingNodeDataEventArgs e) at UmbracoExamine.UmbracoContentIndexer.OnGatheringNodeData(IndexingNodeDataEventArgs e) at Examine.LuceneEngine.Providers.LuceneIndexer.GetDataToIndex(XElement node, String type) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessIndexQueueItem(IndexOperation op, IndexWriter writer) at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessQueueItem(IndexOperation item, ICollection`1 indexedNodes, IndexWriter writer) at Examine.LuceneEngine.Providers.LuceneIndexer.ForceProcessQueueItems(Boolean block), IndexSet: ExternalIndexSet 2016-02-08 09:49:38,656 [P11416/D4/T149] INFO Umbraco.Core.Sync.ApplicationUrlHelper - ApplicationUrl: http://westmidlandscombinedauthority.org.uk:80/umbraco (UmbracoModule request) 2016-02-08 09:49:39,124 [P11416/D4/T98] INFO umbraco.content - Save Xml to file... 2016-02-08 09:49:39,155 [P11416/D4/T162] INFO umbraco.content - Saved Xml to file. 2016-02-08 09:49:39,421 [P11416/D4/T149] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.interfaces.IApplication 2016-02-08 09:49:39,421 [P11416/D4/T149] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.interfaces.IApplication, found 0 (took 0ms) 2016-02-08 09:49:57,626 [P11416/D3/T7] INFO Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: ConfigurationChange

_shutDownMessage=CONFIG change HostingEnvironment initiated shutdown HostingEnvironment caused shutdown

shutDownStack= at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Environment.getStackTrace() at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal() at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace) at System.Web.HttpRuntime.OnConfigChange(String message) at System.Configuration.BaseConfigurationRecord.OnStreamChanged(String streamname) at System.Web.DirectoryMonitor.FireNotifications() at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()

]]>
Nathan Rogan Mon, 08 Feb 2016 11:22:40 +00:00
Sequence contains no elements https://our.umbraco.org/forum/getting-started/installing-umbraco/74895-sequence-contains-no-elements https://our.umbraco.org/forum/getting-started/installing-umbraco/74895-sequence-contains-no-elements I'm having an error when installing a fresh copy of v7.3.7

Error during installation
Sequence contains
no elements

The first couple of lines of the log files shows the following:

2016-02-07 08:05:15,822 [P10416/D2/T11] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Executing installation step: DatabaseConfigure
 2016-02-07 08:05:15,822 [P10416/D2/T11] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step DatabaseConfigure failed.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)

It's a standard SQL Server 2012 Express install on Windows Server 2012 R2. There is only one other database on the server and it's working fine.

Any ideas?

]]>
Joel Sat, 06 Feb 2016 21:30:28 +00:00
Change Link To Document https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74892-change-link-to-document https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74892-change-link-to-document I am using Umbraco 7.3.7 and I need to change url "Link to Document" .  Is it possible to change "Link to document" to correct wording as green highlight

]]>
korn ji Sat, 06 Feb 2016 13:46:00 +00:00
Custom Field Index issue for Rich Text Editor properties https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74891-custom-field-index-issue-for-rich-text-editor-properties https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74891-custom-field-index-issue-for-rich-text-editor-properties Hi Guys,

Having an issue with custom index fields for RTE properties (Other property types seem to be working fine).

Version : 7.3.6

Summary of issue: When trying to access RTE properties on OnApplicationStarted appending to the event GatheringNodeData an error is thrown:

System.NullReferenceException was unhandled by user code
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=umbraco
  StackTrace:
       at Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(String text, Boolean preview)
       at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview)
       at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__0()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__1()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at CreativeJar.Wickes.BrandingPortal.CMS.Handlers.OnApplicationStart.GatheringNodeDataHandler(Object sender, IndexingNodeDataEventArgs e, UmbracoHelper helper) in D:\CodeChronicles\CreativeJar\Branding Portal\Trunk\Code\Wickes.BrandingPortal.CMS\Handlers\OnApplicationStart.cs:line 64
       at CreativeJar.Wickes.BrandingPortal.CMS.Handlers.OnApplicationStart.<>c__DisplayClass2_0.<OnApplicationStarted>b__0(Object sender, IndexingNodeDataEventArgs e) in D:\CodeChronicles\CreativeJar\Branding Portal\Trunk\Code\Wickes.BrandingPortal.CMS\Handlers\OnApplicationStart.cs:line 35
       at Examine.Providers.BaseIndexProvider.OnGatheringNodeData(IndexingNodeDataEventArgs e) in x:\Projects\Examine\Examine\Projects\Examine\Providers\BaseIndexProvider.cs:line 190
       at UmbracoExamine.UmbracoContentIndexer.OnGatheringNodeData(IndexingNodeDataEventArgs e)
       at Examine.LuceneEngine.Providers.LuceneIndexer.GetDataToIndex(XElement node, String type) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1113
       at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessIndexQueueItem(IndexOperation op, IndexWriter writer) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1802
       at Examine.LuceneEngine.Providers.LuceneIndexer.ProcessQueueItem(IndexOperation item, ICollection`1 indexedNodes, IndexWriter writer) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1580
       at Examine.LuceneEngine.Providers.LuceneIndexer.ForceProcessQueueItems(Boolean block) in x:\Projects\Examine\Examine\Projects\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 1537
  InnerException: 

Hookup Code:

var helper = new UmbracoHelper(UmbracoContext.Current);
            ExamineManager.Instance.IndexProviderCollection["ContentIndexer"].GatheringNodeData += (sender, e) => GatheringNodeDataHandler(sender, e, helper);

Error is being thrown here:

foreach (var prop in WidgetProperties.Where(prop => widget.HasProperty(prop) && widget.HasValue(prop)))
                {
                    content.Append(widget.GetPropertyValue<string>(prop));
                }

To isolate the issue I tried accessing a RTE property directly with the same results.

var node = helper.TypedContent(e.NodeId);
var test = node.GetPropertyValue("pageSummary");

Running HasProperty & Has Value returns true

Looking in the immediate window, I can see the value when doing GetProperty("pageSummary") however attempting to access this property throws the same exception,

Unfortunately I am unable to step into the call bur the stack trace seems to indicate that there could be a dependency that is not available at the point of execution.

Does anyone know if I am attempting to do this at the wrong point of execution?

I have tried ways to get the raw value (I am not really concerned about actual links parsing etc) however at the moment I have had no luck.

Many thanks

Les

]]>
LesMac Sat, 06 Feb 2016 12:51:22 +00:00
7.3.4 > 7.4 RC upgrade guide https://our.umbraco.org/forum/getting-started/installing-umbraco/74878-734-74-rc-upgrade-guide https://our.umbraco.org/forum/getting-started/installing-umbraco/74878-734-74-rc-upgrade-guide Is there any guides on upgrading from 7.3.x to 7.4rc. It seems there are a number of breaking changes?

]]>
Claushingebjerg Fri, 05 Feb 2016 14:59:34 +00:00
Default work flow email template. https://our.umbraco.org/forum/umbraco-pro/contour/74864-default-work-flow-email-template https://our.umbraco.org/forum/umbraco-pro/contour/74864-default-work-flow-email-template Is it possible to edit the default email template used to send messages in workflow? Where would I find it?

Thanks

Dan

]]>
Dan Evans Fri, 05 Feb 2016 09:43:49 +00:00
Generate razor for contour form https://our.umbraco.org/forum/umbraco-pro/contour/74775-generate-razor-for-contour-form https://our.umbraco.org/forum/umbraco-pro/contour/74775-generate-razor-for-contour-form I've created a contour form and inserted into a template using: @Umbraco.RenderMacro("umbracoContourRazorRenderForm", new {FormGuid="..."})

This generates a macroscript although it doesn't contain any meaningful razor code which I can add classes etc It just contains an Html.RenderMvcAction passing in action, controller, formGuid, formtoken etc

When I inserted my contour form into the template I selected "Insert from Umbraco contour".

In this video: http://umbraco.com/follow-us/blog-archive/2012/11/8/contour-30-features-full-control-over-form-markup/

After watching the following video I noticed there is also a "razor contour form" option @1.42 although I don't have this option. Later @ 2.02 he shows the razor code.

How do I generate the razor code?

I'm using Umbraco version 7.3.5 and Umbraco Contour version 3.0.28

]]>
Laith Tue, 02 Feb 2016 17:50:16 +00:00
Domains and languages are missing in culture and hostnames on copied website after changing confgs https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74694-domains-and-languages-are-missing-in-culture-and-hostnames-on-copied-website-after-changing-confgs https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74694-domains-and-languages-are-missing-in-culture-and-hostnames-on-copied-website-after-changing-confgs I think I have messed up my site a little bit... I have just migrated our website to another domain/host. For that I've changed some configs a little bit. Now I want to change the domains in Umbraco as well.

I used to have a couple of domains and languages defined in the "culture and hostnames". On the new website all the defined hostnames are gone! I cannot add new domains either, as the dropdown list with languages are empty. It used to be two languages set.

Does anybody know how the list with languages are defined in Umbraco, especially in which config file? Maybe something like web.config or umbracosettings.config?

]]>
Geert van Gorp Fri, 29 Jan 2016 22:29:43 +00:00
VAT number in customer billing address https://our.umbraco.org/projects/collaboration/merchello/merchello/74444-vat-number-in-customer-billing-address https://our.umbraco.org/projects/collaboration/merchello/merchello/74444-vat-number-in-customer-billing-address Is there a way to store VAT number in billing address? I can see a "Company" field, but i need to store VAT number too (CIF in Spain). I suppose it would be an extended property but i guess CustomerAdress dont have extended propertes. What would be the best way for this?

]]>
Tito Wed, 20 Jan 2016 18:38:45 +00:00
Datepicker on change event https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/74400-datepicker-on-change-event https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/74400-datepicker-on-change-event I have the standard datetimepicker displayed in my custom section using this html:

<umb-control-group label="Publish Date" description="The RSS publish date">
       <umb-editor model="datepicker"></umb-editor>
</umb-control-group>

This is how i setup the config for the datepicker:

$scope.datepicker = {
    view: 'datepicker',
    config: {
        pickDate: true,
        pickTime: true,
        useSeconds: true,
        pick12HourFormat: false,
        format: "DD/MM/YYYY HH:mm:ss"
    },
    value: date
};

and I have a $watch event on the datepicker:

$scope.$watch('datepicker', function () {
   if ($scope.datepicker != undefined && $scope.loaded) {
       $scope.form.PubDate = $scope.datepicker.value;
   }
}, true);

For the life of me, I can't seem to grab the new value from the datepicker, the datepicker.value value never seems to get updated?

]]>
ianhoughton Tue, 19 Jan 2016 11:04:27 +00:00
Error on first run after installing a customers site https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74364-error-on-first-run-after-installing-a-customers-site https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/74364-error-on-first-run-after-installing-a-customers-site I get this error on a 7.3 build:

The following errors occurred while attempting to load the app. - The OwinStartupAttribute.FriendlyName value 'UmbracoDefaultOwinStartup' does not match the given value '' in Assembly 'umbraco, Version=1.0.5750.18164, Culture=neutral, PublicKeyToken=null'. - No assembly found containing a Startup or [AssemblyName].Startup class. To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config. To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.

Any ideas? I've even removed owin.dll and the reference from the solution, also added to the web.config and get the same error?

Thanks

]]>
Pete Mon, 18 Jan 2016 12:56:51 +00:00
Understanding template and page problem https://our.umbraco.org/forum/templating/templates-and-document-types/74350-creating-a-case-study-page-without-case-study-being-a-child-a-project https://our.umbraco.org/forum/templating/templates-and-document-types/74350-creating-a-case-study-page-without-case-study-being-a-child-a-project I currently have this content structure in the back end:

Projects List

Project 1

Project 2

Case Studies List

Case Study 1

Case Study 2

Case Study 3

Projects in Projects list have one template so that localhost/project1 will display the html for the project template. The link to document for each case study is /casestudy1 but I want to be able to access the properties on each case study and when a user selects a case study when on the page localhost/project1 to then go to the page localhost/project1/casestudy1

How do I go about doing this? I know how to access the content for case study but not change the url? (i.e localhost/project1/casestudy1) I could create a partial view but I don't know how to pass the case study name to the url. This would be simple if case study was a child of project but I want there to be only one case study in the content that many projects use (This is because different projects use many case studies and they need to be able to change depending on which case studies are checked on the project page)

Summary: Want to create a new sub page of project without having the case study as a child page and url needs to reflect this.

]]>
Laith Sun, 17 Jan 2016 12:25:52 +00:00
REST APIs in Umbraco: Example how to secure api call only from member login? https://our.umbraco.org/forum/developers/api-questions/72647-rest-apis-in-umbraco-example-how-to-secure-api-call-only-from-member-login https://our.umbraco.org/forum/developers/api-questions/72647-rest-apis-in-umbraco-example-how-to-secure-api-call-only-from-member-login Is there an example on how to call api only for authenticate member and not backoffice user?

]]>
Biagio Paruolo Tue, 03 Nov 2015 14:58:20 +00:00
Label datatype stripping leading zeros https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/70784-label-datatype-stripping-leading-zeros https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/70784-label-datatype-stripping-leading-zeros Hi!

I have a label datatype with the value 026601620

I then try to get the value using for example: umbracoProduct.Children(x => x.DocumentTypeAlias.Equals("ProductItem")).Select(x => x.GetPropertyValue("productItemId"))

This comes back as 26601620 (missing the leading zero). If I try it where the label is for example 826601620 it returns as it should.

Any idea why Umbraco would strip the leading zero on a label datatype?

]]>
Joss Mon, 24 Aug 2015 13:50:09 +00:00
UmbracoContext.Current.PublishedContentRequest.PublishedContent Null Refernace https://our.umbraco.org/forum/developers/razor/67205-umbracocontextcurrentpublishedcontentrequestpublishedcontent-null-refernace https://our.umbraco.org/forum/developers/razor/67205-umbracocontextcurrentpublishedcontentrequestpublishedcontent-null-refernace I am looking to set-up a custom route and custom view model however are getting a null reference error.

I have been using the code based on this previous post

The Route:

var locationRoute = RouteTable.Routes.MapRoute("location", "area/{location}", new { controller = "MyAreas", action = "MyAreas", location = UrlParameter.Optional });  
locationRoute.RouteHandler = new PublishedPageRouteHandler((int)WellKnownPages.MyAreasPublishedPage);

The Handler:

public class PublishedPageRouteHandler : IRouteHandler
    {
        public PublishedPageRouteHandler(int pageId)
        {
            _pageId = pageId;
        }
        private readonly int _pageId;
        private UmbracoHelper _umbraco;
        public UmbracoHelper Umbraco
        {
            get { return _umbraco ?? (_umbraco = new UmbracoHelper(UmbracoContext.Current)); }
        }
        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            //we want to lookup the document by id
            var content = Umbraco.TypedContent(_pageId);
            if (content != null)
            {
                requestContext.RouteData.DataTokens["umbraco"] = new RenderModel(content, CultureInfo.CurrentUICulture);
                UmbracoContext.Current.HttpContext.Items["pageID"] = _pageId;

                var docRequest = UmbracoContext.Current.PublishedContentRequest;//this is null
                requestContext.RouteData.DataTokens.Add("umbraco-doc-request", UmbracoContext.Current.ContentCache.GetById(_pageId)); //required for RenderMvcController
            }
            return new MvcHandler(requestContext);
        }
    }

The Controller:

 public class MyAreasController : RenderMvcController
    {

    public ActionResult MyAreas(RenderModel model, string location)
    {
        return CurrentTemplate(new LocationModel(location));
    }

}

The Model:

 public class LocationModel :  RenderModel
    {
        public string SelectedLocation { get; set; }

        public LocationsModel(string location) : base(UmbracoContext.Current.PublishedContentRequest.PublishedContent)
        {
              SelectedLocation = location;
        }
    }

The exception happens when the model is created as UmbracoContext.Current.PublishedContentRequest.PublishedContent is null.

Any suggestions?

]]>
John Fri, 03 Jul 2015 07:36:52 +00:00
"Error loading Partial View script" while "return CurrentUmbracoPage()" https://our.umbraco.org/forum/developers/api-questions/63326-Error-loading-Partial-View-script-while-return-CurrentUmbracoPage() https://our.umbraco.org/forum/developers/api-questions/63326-Error-loading-Partial-View-script-while-return-CurrentUmbracoPage() Hello People,

I´m a beginner at Umbraco, so right now I´m trying to create a simple Contact form, which I is almost complete, except by the validation data which I can´t return without the error:

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

 

I´ve been reading a lot about this thread, but still not sure what the problem is.

This is the code that I got:

 

MacroPartials/ContactForm.cshtml

@inherits Umbraco.Web.Macros.PartialViewMacroPage

@Html.Action("ContactUsForm", "Contact")

 

Partials/ContactUsForm.cshtml

@model StoreMVC.Models.ContactModel

@using (Html.BeginUmbracoForm("ContactUsForm", "Contact"))
{
@Html.ValidationSummary(true)

Contact Us








@Html.ValidationSummary(true)




@Html.LabelFor(x => x.Name)
@Html.TextBoxFor(x => x.Name)
@Html.ValidationMessageFor(x => x.Name)




@Html.LabelFor(x => x.Email)
@Html.TextBoxFor(x => x.Email)
@Html.ValidationMessageFor(x => x.Email)




@Html.LabelFor(x => x.Phone)
@Html.TextBoxFor(x => x.Phone)
@Html.ValidationMessageFor(x => x.Phone)





@Html.LabelFor(x => x.Message)
@Html.TextAreaFor(x => x.Message)
@Html.ValidationMessageFor(x => x.Message)




}

 

Controllers/ContactController.cs

using StoreMVC.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web;

namespace StoreMVC.Controllers
{
public class ContactController : Umbraco.Web.Mvc.SurfaceController
{
[ChildActionOnly]
public ActionResult ContactUsForm()
{
var model = new ContactModel();


//In case you need to access the current node
var currentNode = Umbraco.TypedContent(UmbracoContext.PageId.GetValueOrDefault());


return PartialView("ContactUsForm", model);
}


[HttpPost]
public ActionResult ContactUsForm(ContactModel model)
{
// server validation here
TempData["ErrorMessage"] = "Error processing field ...";

if (ModelState.IsValid)
{
var currentNode = Umbraco.TypedContent(UmbracoContext.PageId.GetValueOrDefault());

var homeNode = currentNode;

var sendEmailsFrom = homeNode.GetPropertyValue("sendEmailsFrom") ?? model.Email;
var sendEmailsTo = homeNode.GetPropertyValue("sendEmailsTo") ?? "miguel.pires@sysmatch.com";

var body = String.Format("From: {0},

Email: {1},

Tel: {2},

Message: {3}", model.Name, model.Email, model.Phone, model.Message);
var subject = "StoreMVC - Contact";


try
{
umbraco.library.SendMail(sendEmailsFrom, sendEmailsTo, subject, body, true);

TempData["InfoMessage"] = "Your message has been successfully sent and we will be in touch soon...";

// Clear all the form fields
ModelState.Clear();
model.Name = string.Empty;
model.Phone = string.Empty;
model.Email = string.Empty;
model.Message = string.Empty;


//redirect to current page to clear the form
return RedirectToCurrentUmbracoPage();
}
catch (Exception ex)
{
TempData["ErrorMessage"] = ex.Message + ex.StackTrace;
}
}


return CurrentUmbracoPage();

}
}
}

 

Models/ContactModel.cs

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace StoreMVC.Models
{
public class ContactModel
{
[Required(ErrorMessage = "Name is required")]
public string Name { get; set; }

[Required]
public string Email { get; set; }

[Required]
public string Phone { get; set; }

[Required]
public string Message { get; set; }
}
}

 

Any help, would be really appreciated!

Regards


]]>
Miguel P Thu, 19 Mar 2015 14:33:31 +00:00
Saving CDATA in Umbraco 7 https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60287-Saving-CDATA-in-Umbraco-7 https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60287-Saving-CDATA-in-Umbraco-7 Is there a way in Umbraco 7 to save script-elements with CDATA in the umbraco.xml?

When trying to publish a textbox multiple with CDATA I get the error "Cannot have ']]>' inside an XML CDATA block.".

Umbraco 6 had the old datatype textbox multiple that allowed to save CDATA tags by replacing:
    _data.Value = this.Text.Replace("<![CDATA[", "<!--CDATAOPENTAG-->").Replace("]]>", "<!--CDATACLOSETAG-->");

]]>
kammalanda Fri, 09 Jan 2015 11:29:25 +00:00
Glimpse doesn't do anything? https://our.umbraco.org/projects/developer-tools/glimpse7/questions-and-suggestions/53031-Glimpse-doesnt-do-anything https://our.umbraco.org/projects/developer-tools/glimpse7/questions-and-suggestions/53031-Glimpse-doesnt-do-anything Hi, I installed Glimpse in a fresh install of 7.1.3, nothing happens when I append the querystring to the URL.

Am I missing something?


-Amir

 

]]>
Amir Khan Wed, 21 May 2014 22:19:38 +00:00
Get all published content where the document type is a child of a specific parent document type https://our.umbraco.org/forum/developers/razor/45500-Get-all-published-content-where-the-document-type-is-a-child-of-a-specific-parent-document-type https://our.umbraco.org/forum/developers/razor/45500-Get-all-published-content-where-the-document-type-is-a-child-of-a-specific-parent-document-type I have the following situation. I have a 'Basepage' document type from which I create child document types for each of my page types eg. 'homepage', 'genericpage' etc.

It's easy to find all children of a particular content node but what I want to do is find all children where their document type derives from the 'Basepage' document type.

So basically anything with a nodetypealias of 'homepage' or 'genericpage' etc.

]]>
Sam Aspin Wed, 16 Oct 2013 13:30:23 +00:00
Validate the Start date and End date in the ucomponents datatype grid https://our.umbraco.org/forum/using/ui-questions/45358-Validate-the-Start-date-and-End-date-in-the-ucomponents-datatype-grid https://our.umbraco.org/forum/using/ui-questions/45358-Validate-the-Start-date-and-End-date-in-the-ucomponents-datatype-grid Is there a way to validate the Start and End dates of an item, like start date should be lesser than the end date , ,overlapping date in the grid and raise the alert. Please refer the the below screen capture.

 

Thanks in Advance!

Govind

]]>
Govindarajan Ponnusamy Thu, 10 Oct 2013 11:55:22 +00:00