Quantcast
Channel: ActiveTopics
Viewing all 72689 articles
Browse latest View live

UmbracoContext issues in hangfire/service job. (possible Dependency Injection)

$
0
0

Hi.

I'm using the LightInject Dependency Injection and running Hangfire to do some scheduled tasks. I think I've gotten Hangfire to work using one of two methods:

One by mocking a HttpContext when resolving the Scope of Lightinject, or two - by using another container for Hangfire and re-registering all services from the existing container.

Both of these seems to work. My issue comes from the application layer which I'm calling from my Hangfire job.

Suppose the following simplified example: From Hangfire I'm calling MyService.MyMethod() which needs to lookup content from Umbraco. I am doing the following simplified:

public class MyService : IMyService
{
    private readonly IUmbracoContextFactory _umbracoContextFactory;

    public MyService (IUmbracoContextFactory umbracoContextFactory)
    {
        _umbracoContextFactory = umbracoContextFactory;
    }

  public void MyMethod()
 {
       using (var contextFactory = _umbracoContextFactory.EnsureUmbracoContext())
        {                
            var myContent = contextFactory.UmbracoContext.Content.GetAtRoot().OfType<MyContent>()?.FirstOrDefault();
        }
 }
}

This does seem to work and I can view the correct content in myContent.

However afterwards, from somewhere, I also get a null pointer exception with the stacktrace

at Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(String text, Boolean preview, UmbracoContext umbracoContext)
       at Umbraco.Web.PropertyEditors.ValueConverters.TextStringValueConverter.ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, Object source, Boolean preview)
       at Umbraco.Core.Models.PublishedContent.PublishedPropertyType.ConvertSourceToInter(IPublishedElement owner, Object source, Boolean preview)
       at Umbraco.Web.PublishedCache.NuCache.Property.GetInterValue(String culture, String segment)
       at Umbraco.Web.PublishedCache.NuCache.Property.GetValue(String culture, String segment)
       at Umbraco.Web.PublishedPropertyExtension.Value[T](IPublishedProperty property, String culture, String segment, Fallback fallback, T defaultValue)
       at Umbraco.Web.PublishedContentExtensions.Value[T](IPublishedContent content, String alias, String culture, String segment, Fallback fallback, T defaultValue)

This time the UmbracoContext is null in ParseInternalLinks It seems because "something" else is calling NuCache (perhaps a rendering that's triggered in the background or something?), but I don't understand what that is and I cannot seem to trace it back.

Does anybody have something that can help me shed some light on the issue and maybe point out where I am taking a wrong turn?

Thanks in advance.


Umbraco Forms NullReferenceException with logged in user

$
0
0

Has anyone came across the error detailed here; https://our.umbraco.com/forum/umbraco-forms/76675-umbraco-forms-nullreferenceexception-with-logged-in-user ; our front end sign in is Azure b2c.. running umbraco 7.13.1 and forms 7.0.1(newest forms version still produces error). The form renders fine if you're not front end logged in to azure b2c.

[NullReferenceException: Object reference not set to an instance of an object.]
   Umbraco.Core.Cache.HttpRequestCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem) +293
   Umbraco.Core.Cache.CacheProviderExtensions.GetCacheItem(ICacheProvider provider, String cacheKey, Func`1 getCacheItem) +174
   Umbraco.Web.Security.MembershipHelper.GetCurrentMember() +38
   Umbraco.Web.Security.MembershipHelper.GetCurrentMemberId() +44
   Umbraco.Forms.Web.Controllers.UmbracoFormsController.GetFormModel(Guid formId, Nullable`1 recordId) +110
   Umbraco.Forms.Web.Controllers.UmbracoFormsController.RenderForm(Guid formId, Nullable`1 recordId, String theme, Boolean includeScripts) +21
   lambda_method(Closure , ControllerBase , Object[] ) +344
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +209
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +40
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +43
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +43
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +36
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +1796
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +20
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +20
   System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +19
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +29
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1363

[HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1971
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +131
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +29
   System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +587
   System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, Object routeValues) +64
   ASP._Page_Views_MacroPartials_InsertUmbracoFormWithTheme_cshtml.Execute() in s:\Live\apprenticeships.scot\20190410\Views\MacroPartials\InsertUmbracoFormWithTheme.cshtml:47
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +220
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +77
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +194
   Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) +266
   Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) +870
   umbraco.macro.LoadPartialViewMacro(MacroModel macro) +86
   umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId) +3019
   Umbraco.Web.UmbracoComponentRenderer.RenderMacro(macro m, IDictionary`2 parameters, page umbracoPage) +474
   ASP._Page_Views_Partials_NestedContentBlocks__formWithRTE_cshtml.Execute() in s:\Live\apprenticeships.scot\20190410\Views\Partials\NestedContentBlocks\_FormWithRte.cshtml:17
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +220
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +77
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +194
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +118
   ASP._Page_Views_TakeOnAnApprentice_cshtml.Execute() in s:\Live\apprenticeships.scot\20190410\Views\TakeOnAnApprentice.cshtml:19
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +220
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +77
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +86
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +194
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +373
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +629
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +629
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +629
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +1796
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +20
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +20
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +6001
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +1382

enter image description here

Change members password programmatically

$
0
0

I'm new in Umbraco. I need to implement changing members password.

I have the endpoint:

public BaseResponse Put(UpdatePasswordModel model)
    {
        var response = new BaseResponse();

        if (!ModelState.IsValid)
        {
            response.Code = ErrorCode.WrongUsernameOrPassword;
            response.Message = "Wrong username or password!";
            return response;
        }

        var member = _memberService.GetByUsername(model.UserName);

        if (member == null)
        {
            response.Code = ErrorCode.MemberNotFound;
            response.Message = $"Member {model.UserName} not found";

            return response;
        }

        var passwordModel = new ChangingPasswordModel { NewPassword = model.NewPassword, OldPassword = model.OldPassword };
        _membershipHelper.ChangePassword(model.UserName, passwordModel, "UmbracoMembershipProvider");

        response.Code = ErrorCode.Success;

        return response;
    }

UpdatePasswordModel contains UserName, OldPassword, NewPassword.

Has ChangePassword metdod some validation for old and new passwords? What is the best way to change members password?

FileSystemProviders Section umbraco 8 to change media location

$
0
0

Hi, Where is the FileSystemProvidersSection in umbraco 8? I wanna change the media location.

MNTP XPath with multi-culture site

$
0
0

Hi guys,

We have a multi-culture build that has several sites.

  • EN
  • AU
  • FR
  • Etc...

Each site has it's own collection of shareable content that can be 'picked' from nodes within that domain. The tree looks like this:

  • EN

    • Home (host and domain set here)
      • About
      • Contact
    • Shared Content
      • Widgets
        • Widget 1

      We have created a MNTP that uses XPath to resolve to the Shared Content folder for the current site:

    $site/sharedContent/widgets
    

    We expect this to resolve to the Widgets folder for the current culture. And well... it works for the first site, but for all other sites, it doesn't resolve to anything.

    I have tried trimming the selector right back to just $site, and it resolves to the correct root node. But, when I do this, all descendant nodes show in brackets, which makes me think that the current culture is not being passed to the MNTP XPath selector:

    enter image description here

    I've tried associating domains and cultures to the shared content node, but that doesn't seem to do anything.

    Has anyone else bumped into this? And if so how did you get around it?

    Any help is greatly appreciated.

    TIA

    Phil

Remove query string from image paths

$
0
0

Hi, I am having issues with image files on iOS devices. The query string that Umbraco 8 places at the end of an image url is preventing these images displaying on iOS devices. Seems fine on other devices.

for example: /media/zzyljno0/calculator-and-pen-225.jpg?width=225&height=166

In Umbraco 7, the same image would render fine, with the query string present: for example: /media/1223/calculator-and-pen-225.jpg?width=225&height=166

Please can someone let me know how to prevent this query string from being added to the image path. When I remove it (manually in Dev tools, for example), the images is rendered correctly.

Has anyone else had this issue?

Thank you,

Kind regards,

Pete

Umazel model generator issue

$
0
0

Just tried to update the service item doc type with a media picker center image then went into the developer section and executed the model rebuilder and now getting the below error and can not even get into umbraco anymore:

Line 27:             //TODO: Get image from media and image cropped correctly
Line 28:             IPublishedContent mediaItem = null;
Line 29:             if (!string.IsNullOrEmpty(item.ListImage))
Line 30:             {
Line 31:                 mediaItem = item.GetPickerMediaByValue(item.ListImage).First();

Please help.

Multi-page Form - save data

$
0
0

Hi, We're in a middle of strategic project to our company. As part of this project we're using Umbraco Forms and with the multi-page form options. However it's mandatory for us to save the data between pages so the user can return back to see the data and continue the process. In addition the marketing team need to know if users got stuck in the process in between.

I've searched for a solution for this (via coding) however until now I didn't found concrete guide on how to implement it in Umbraco Forms. I saw other packages might support it (Umbraco Contour or FormEditor) but I really don't want to go back to old versions and loose Umbraco Forms benefits. In addition I purchased it and seems to me like basic functionality to be able to save partial data in between pages.

Appreciate your help here since our project got stuck due to this issue.

Thank you in advance, Moshe


Filters

$
0
0

Hello

I have used Merchello for several, smaller, projects but for this particular implementation I am wanting to filter products based on a user selection.

I was assuming that the Specified Filters could be used for this purpose, but I am having finding any documentation on how these can be accessed in a view.

In my example I have a single filter called "Product Type" with values such as - Table, Chair, Sofa, Armchair, Suite, Side Table, Homeware - each product can belong to multiple filters, i.e. a leather Lay-z-boy recliner can belong in the Armchar, Chair and Suite filters.

So far I have been able to successfully add a filter group into the system (Merchello --> Products --> Filter Groups --> Add) as well as adding multiple filters to a product (Merchello --> Products --> [product] --> Product Filters -- > tick multiple filter)

I have successfully been able to extract all of the filters which I have entered into the system using the following

MerchelloHelper merchelloHelper = new Merchello.Web.MerchelloHelper();    
var filterGroups = merchelloHelper.Filters.Product.GetAll();

This allows me to get all of the filter groups and then iterate through them to get the Name and Key of each of the filters, but this is where I run out of information.

What I would like to do is:

1: Only output the filters which are used by a (list of) products

2: Output the filters which are selected for a product

Any help on this would be very much appreciated. I will also report back if I come across a solution during my continued investigation.

Regards, Andrew

EDIT: I am using v2.6.0 of Merchello

UmbracoFileSystemProviders.Azure + Our.Umbraco.AzureCDNToolkit - Serve mp4s

$
0
0

Hi! I've (semi) successfully moved the media library to Azure Blob Storage and also configured the Azure CDN. It works as expected for my images. But my mp4-files which are rendered in html video-tags doesn't get picked up by the CDN.

Can anyone explain why and if there's something I can do about it?

<FileSystemProviders>
  <!-- Media -->
  <Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
    <Parameters>
      <add key="containerName" value="media-local"/>
      <add key="rootUrl" value="https://xxx.blob.core.windows.net/"/>
      <add key="connectionString" value="***"/>
      <!--
    Optional configuration value determining the maximum number of days to cache items in the browser.
    Defaults to 365 days.
  -->
      <add key="maxDays" value="365"/>
      <!--
    When true this allows the VirtualPathProvider to use the deafult "media" route prefix regardless 
    of the container name.
  -->
      <add key="useDefaultRoute" value="true"/>
      <!--
    When true blob containers will be private instead of public what means that you can't access the original blob file directly from its blob url.
  -->
      <add key="usePrivateContainer" value="false"/>
    </Parameters>
  </Provider>

</FileSystemProviders>


<imageProcessor>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
        <service prefix="remote.axd" name="RemoteImageService"
                 type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
          </whitelist>
        </service>
        <service prefix="media/" name="CloudImageService"
                 type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value="media-local" />
            <setting key="MaxBytes" value="8194304" />
            <setting key="Timeout" value="30000" />
            <setting key="Host" value="https://xxx.blob.core.windows.net/" />
          </settings>
        </service>
        <service name="AzureImageService"
                 type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureImageService, ImageProcessor.Web.Plugins.AzureBlobCache">
          <settings>
            <setting key="StorageAccount"
                     value="***" />
            <setting key="Container" value="media-local" />
            <setting key="AccessType" value="Blob" />
          </settings>
        </service>
      </services>
    </security>
    <caching currentCache="AzureBlobCache">
      <caches>
        <cache trimCache="false" name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" memoryMaxMinutes="1" browserMaxDays="7">
          <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings>
        </cache>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365">
          <settings>
            <setting key="CachedStorageAccount" value="***" />
            <setting key="CachedBlobContainer" value="cache" />
            <setting key="UseCachedContainerInUrl" value="true" />
            <setting key="CachedCDNRoot" value="https://xxx.azureedge.net" />
            <setting key="CachedCDNTimeout" value="2000" />
            <setting key="SourceStorageAccount" value="" />
            <setting key="SourceBlobContainer" value="" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
      </caches>
    </caching>
    <processing configSource="config\imageprocessor\processing.config" />
  </imageProcessor>

Examine MultiSearcher and PDFIndex not working

$
0
0

Hi, I've followed the docs and implemented PDFIndex and MultiSearcher.

In the backend these are both healthy and return results.

However, when I use them in code I get zero results from the PdfIndex either directly or via the MultiSearcher.

This is the code which creates the PdfIndex and MultiSearcher...

public void Initialize()
        {
            //Get both the external and pdf index
            if (_examineManager.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out var externalIndex)
                && _examineManager.TryGetIndex(PdfIndexConstants.PdfIndexName, out var pdfIndex))
            {
                //register a multi searcher for both of them
                var multiSearcher = new MultiIndexSearcher("MultiSearcher", new IIndex[] { externalIndex, pdfIndex });
                _examineManager.AddSearcher(multiSearcher);
            }
        }

This is how I'm searching the PdfIndex directly...

var textFields = new[]
            {
                "title", "description", "content", "bodyText", "location", "pageHeading", "subHeading",
                "nodeName", "__NodeTypeAlias"
            };

if (ExamineManager.Instance.TryGetIndex("PDFIndex", out index))
                {
                    searcher = index.GetSearcher(); ;

                    var query = searcher.CreateQuery("media").GroupedOr(textFields, searchQuery.Fuzzy(0.2f));
                    results = query.Execute();
                }

...and this is a search against the MultiSearcher

if (_searchPdf && ExamineManager.Instance.TryGetSearcher("MultiSearcher", out searcher))
                {
                    var query = searcher.CreateQuery("media,content").GroupedOr(textFields, searchQuery/*.Fuzzy(0.2f)*/);
                    results = query.Execute();
                }

I suspect I'm phrasing the search incorrectly. I'll continue to "fiddle" and strip the code down to minimum.

Suggestions appreciated.

Query content nodes in Umbraco 8

$
0
0

Hi,
I'm working on updating a v7 site to v8 and having trouble re-using some code that locates the root node and then queries descendants based on various characteristics. This is in a C# class file so had been using the UmbracoHelper - such as helper.ContentAtRoot().First() - which seems like it doesn't work in Umbraco 8.
Does anyone have a suggestion?
Thanks, Steve

Running custom scripts during deployment (Umbraco cloud)

$
0
0

Hi! I'm using AzureCDNToolkit quite successfully except for one thing. I'm bundling my js/css using webpack when I'm deploying. I was wondering if it's possible to run custom scripts before or after deploying between my different environments. What I would like to accomplish is pushing my bundled css and js files to different containers (separate ones for each environment) in Azure Blob Storage, so I can resolve them using ResolveCdn().

Anyone has any ideas?

Visual Studio 2019 Frustrations

$
0
0

I am attempting to work with templates in Visual Studio 2019 after creation in the Umbraco Back Office (using Umbraco V.8.3).

Whenever I create a new document type and attempto open the associated template/view in Visual Studio, I instantly receive an error stating that the

type or namespace name 'HomePage' does not exist in the namespace 'Umbraco.Web.PublishedModels'.

I thought I was able to use VS, but it appears I cannot (?).

Am I missing something?

Thank you, Bill Even CTG

Database deployment recommendations

$
0
0

Hi there,

We've inherited an Umbraco site and I'm relatively new to developing in Microsoft. We've made a lot of changes in the CMS and the code of the site we're working on and just needing advice on the best solution for deploying database changes (re-adding them in the interface on staging and live isn't a feasible option).

I tried using uSync to transfer content, but came across too many issues to consider this as a stable solution in the long run. I looked at the Courier app, however it isn't built to work on the version of Umbraco we have (7.4.3).

Just wondering what other people are doing for deployment and what you guys would recommend for our set up? The site is hosted on Azure, and if we upgraded to Umbraco 7.9 we could look at using the Courier app (trying to come up with the most cost effective solution for the client).

Many thanks,

Victoria


multinode treepicker in linq

$
0
0

Hi, I have document type Deal having multinode treepicker named device that is picking nodes with type Device. The Device nodes all have Id that's the umbraco Id.

Now I have integer value "did". I need to select all the Deals that have once selected in the multinode treepicker the node with the Id equals to did.

selection = selection.Where(x => (((Deal)x).Device != null) && ...); //The problem is the code where the ... are.

Please advice what do I put in the ...

Umbraco TV - What videos for a Personal subscription

$
0
0

Hi,

I'm a bit confused as to whether there is access to the complete set of videos using the Personal subscription to Umbraco tv.

In the Subscriptions page it says "Access to all videos and sample source code for select tutorials" for the Personal Version and for the Business Version it says "access to all videos online with all the perks of a normal .tv account".

I have had a good hunt round the site, forums and wiki and cant find anything that clarifies it. Any help much appreciated.

Cheers

Steve 

Create new content nodes programmatically in Umbraco 8.

$
0
0

Hello,

In Umbraco 7 I used the following code to generate code programmatically from C# (controller)

using ContentService.CreateContent

And following is the code for the same

       int parentID = 1100;

        var request = ContentService.CreateContent("New Node Name", parentID, ContactUsForm.ModelTypeAlias);

        request.SetValue(ContactRequestItem.GetModelPropertyType(C => C.FirstName).PropertyTypeAlias, FormModel.FirstName);

        ContentService.PublishWithStatus(request);

Now in Umbraco 8

it is asking for

Udi ParentId

getting error "Can not convert 'int' to 'Umbraco.Core.Uid' ".

Have searched a lot, but can't find anything for Umbraco 8.

So now the question is How we can create a node from a controller in Umbraco 8?

Thanks BJ

Collisions detected after creating Visual Studio solution

$
0
0

After cloning the git repo locally and running, I get this error message saying "Collisions detected" but it does not tell me which files collide. The error is only in my local machine and not in the cloud environment. I have found the documentation on this error less than helpful. enter image description here

Publish very slow and crashes the website

$
0
0

I have two issues at the moment - both related to Publish function in Umbraco.

I have v 7.15.1 but it happened also in 7.6.0

First issue is that IContent.Publish action is very slow. I have a number of functionality which does publish content to umbraco eg. in the memebr area where memers can create their own content and products.

To perform Publish is very time consuming and I'm talking here in tens of seconds.

Is it so slow for you guys as well? Can anything be done to make it work faster?

The second issue is that performing publish in the CMS crashes the website - I think it crashes the certificate because after the publish I am logged out of the CMS and the website shows Secure Connection Failed error.

This happens only every some time, I only guess it has something to do with the server performance although the server shows no problems in this regards. We have only one, no load balanced or cloud, just a dedictaed server. We are advised to update and reboot it every month. But seriously why would it affect the secure connection if we don't?

Also why would Publish action in the CMS crash it?

Viewing all 72689 articles
Browse latest View live


Latest Images