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

MNTP

$
0
0

hello i am tried to use examine search and want to add field to search criteria like this

searchCriteria.NodeTypeAlias("itemNews").And().Field("property", "value");

now the property value is a multi node tree picker and i want to check if a tree picker property have a specific node how can i do that ?


Swear word in CMS

$
0
0

Just done a fresh install of 7.0.12 and was mortified to see a swear word at the login screen, as seen in the attached screenshot. I thought that Umbraco was more professional than this and I am offended.

enter image description here

Umbraco Forms 8 cant read table from db?

$
0
0

Hi!

I got a strange issue with Umbraco Forms v.8.1.1 running on Umbraco v.8.0.0.

The forms package is installed with Nuget and works fine running locally but when running on production server with another db( a copy of dev db) I get the following error when clicking on the "forms" tab in the backoffice "ExceptionMessage":"Invalid object name 'UFUserSecurity'.","ExceptionType":"System.Data.SqlClient.SqlException at Umbraco.Forms.Data.Storage.UserSecurityStorage.GetUserSecurity(Object userId)". Same error when clicking on users under the "Form security" folder in the backoffice. I know that the table "UFUserSecurity" exist in the db and the db user has the right permissions but still there seems to be this issue of not finding the table? I also noticed that "UFUserSecurity" isnt updated with new users when adding new users. This also works locally. I noticed that if I uninstall the forms package and reinstall it again the db-tables are not re-created in the db, even if its towards a db where the tables arent present?

I have been looking for the marker files "/App_Data/TEMP/formsupdate" etc for the table creation but they dont seem to make any difference and maybe this has changed in v.8?

Has anyone had similar problems?

BR

Henrik

Extending Models

$
0
0

Hi Our,

Currently have an strange issue, because i can't extend my "NewsArticle" model, maybe it's me that is doing it wrong..

Because i have an doc type named "News Article", which have inherited the doc type "News Meta", in the "News Meta" i have an heading field which i want to extend but when i regenerate my models it won't stop generating the heading field, which means i get this error,

The type 'NewsArticle' already contains a definition for 'NewsHeading'

The generated field looks like this,

    ///<summary>
    /// Overskrift
    ///</summary>
    [ImplementPropertyType("newsHeading")]
    public string NewsHeading
    {
        get { return ProjectName.Core.Models.NewsMeta.GetNewsHeading(this); }
    }

And the code i have written looks like this,

[ImplementPropertyType("newsHeading")]
    public string NewsHeading
    {
        get
        {
            string newsHeading = NewsMeta.GetNewsHeading(this);
            if (string.IsNullOrWhiteSpace(newsHeading))
            {
                newsHeading = OpenGraphSharing.GetOgTitle(this);

                if (string.IsNullOrWhiteSpace(newsHeading))
                {
                    newsHeading = SEO.GetMetaTitle(this);

                    if (string.IsNullOrWhiteSpace(newsHeading))
                    {
                        newsHeading = this.Name;
                    }
                }
            }
            return newsHeading;                  
        }
    }

The funny part is i have done the same thing with many other thing which works, but they didn't have inherited doc types?

Fallback on crop url in V8

$
0
0

Hi umbracians,

Testing umbraco v8 i would like to show an image on my multilingual website. I have danish and english language. It should be possible to have different images on each language, but if no image is set on danish, it should fallback to the english image. In this case it is a image cropper data type, but could be a image picker as well.

It works fine if i do this:

@Model.Value("introImage", fallback: Fallback.ToLanguage)

But what if I want to have the cropped image?

<img src="@Url.GetCropUrl(Model, propertyAlias: "introImage", height: 550, width: 550)" class="banner-image img-responsive" )" />

How can i implement fallback here? Is it possible?

Slow form submission on Umbraco Forms 4.4.7

$
0
0

Hi, we built a site in 2017 using Umbraco Forms 4.4.7 on Umbraco 7.5.14 for one of our clients and it’s been running without issue for over a year until yesterday when a newly added form starting showing problems with submissions taking a long time.

The site is hosted on AWS and so displays a 504 Gateway Time-out error as the form submission page takes too long to respond (up to 6 minutes). The form will usually work once per session and then on further submissions in the same session it times out.

I’ve tried debugging the issue, inserts into UFRecords look to run OK but the trace shows a lot of “In member mode” and “Parsing Member placeholders stop” items which on occasion have large time intervals between them suggesting a lock up somewhere.

Is there anything further I can do to debug this?

Could the AWS hosting be an issue?

Add custom icon to Doctype in backoffice

$
0
0

Hi guys :) In umbraco 8, can you add your own custom icons to a doctypes ?

enter image description here

Handling Workflow Failure

$
0
0

I've developed a custom workflow to submit form data to a third party system. This submission can either succeed or fail and in the event of a failure it is important to let the user know it has not succeeded. I notice on the workflow's Execute method I can set WorkflowExecutionStatus.Failed in the event that the third party system does not accept the data but there doesn't seem to be any obvious way to handle this failure.

Ideally what I'd like is to either redirect the user back to the form and pop an error message, or even redirect them to a different page than the page specified in the "On Submit" dialog.

Any ideas?


Manually firing OrderConfirmation Trigger / Notification

$
0
0

If I run the following code:

Notification.Trigger("OrderConfirmation", new PaymentResult(Attempt<IPayment>.Succeed(), invoice, false), new[] { email });

with an invoice instance that I've created using checkoutManager.payment.PrepareInvoice() and InvoiceService.Save(invoice) should I expect a notification to fire if SMTP notifications are enabled and there is a tempalte for Order Confirmation.

If I run this in debug and step over the Trigger line I get:

Unable to cast object of type 'Merchello.Core.Models.MonitorModels.PaymentResultNotifyModel' to type 'Umbraco.Core.Models.IPublishedContent' in IntelliTrace and no e-mail (however the invoice is created and appears in 'sales' in the backoffice).

Thanks in advance for any assistance

Umbraco 7.6 - Move Node programmatically c#

$
0
0

hi all

I am trying to move a node to another folder, is checkbox is checked or unchecked. But getting a server error, I can't figure out.

Code:

public UmbracoEventHandlers()
    {

        ContentService.Saving += ContentService_Saving;

        ContentService.Saved += ContentService_Saved;

        ContentService.Publishing += ContentService_Publishing;


    }

    void ContentService_Saving(IContentService sender, SaveEventArgs<IContent> e)       {

        foreach (IContent item in e.SavedEntities)
        {
            if (item.HasProperty("messageArchived"))
            {
                if (item.Properties["messageArchived"].IsDirty())
                {
                    var isArchived = Convert.ToBoolean(item.Properties["messageArchived"].Value);
                    var contentService = ApplicationContext.Current.Services.ContentService;

                    if (isArchived)
                    {

                        var archiveContent = item.Parent();
                        IContent archiveMessageFolderContent = null;

                        foreach (IContent child in archiveContent.Children())
                        {
                            if (child.ContentType.Alias == "messageArchive")
                            {
                                archiveMessageFolderContent = child;
                                break;
                            }
                        }

                        contentService.Move(item, archiveMessageFolderContent.Id);
                        library.RefreshContent();
                    }
                    else
                    {
                        var archiveContent = item.Parent().Parent();
                        contentService.Move(item, archiveContent.Id);
                    }

                }
            }
        }
    }
    void ContentService_Saved(IContentService sender, SaveEventArgs<IContent> e)
    {

    }
    void ContentService_Publishing(IPublishingStrategy sender, PublishEventArgs<IContent> e)
    {

    }

Error:

Received an error from the server

An error occurred

Object reference not set to an instance of an object.

Exception Details:

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

at websiteumbracoext.UmbracoEventHandlers.ContentServiceSaving(IContentService sender, SaveEventArgs1 e) in classes\UmbracoEventHandlers.cs:line 59 at Umbraco.Core.Events.ScopeEventDispatcherBase.DispatchCancelable[TSender,TArgs](TypedEventHandler2 eventHandler, TSender sender, TArgs args, String eventName) at Umbraco.Core.Services.ContentService.SaveAndPublishDo(IContent content, Int32 userId, Boolean raiseEvents) at Umbraco.Core.Services.ContentService.PerformMove(IContent content, Int32 parentId, Int32 userId, ICollection1 moveInfo) at Umbraco.Core.Services.ContentService.Move(IContent content, Int32 parentId, Int32 userId) at website_umbracoext.UmbracoEventHandlers.ContentService_Saving(IContentService sender, SaveEventArgs1 e) in classes\UmbracoEventHandlers.cs:line 59 at Umbraco.Core.Events.ScopeEventDispatcherBase.DispatchCancelable[TSender,TArgs](TypedEventHandler2 eventHandler, TSender sender, TArgs args, String eventName) at Umbraco.Core.Services.ContentService.SaveAndPublishDo(IContent content, Int32 userId, Boolean raiseEvents) at Umbraco.Core.Services.ContentService.Umbraco.Core.Services.IContentServiceOperations.SaveAndPublish(IContent content, Int32 userId, Boolean raiseEvents) at Umbraco.Core.Services.ContentService.SaveAndPublishWithStatus(IContent content, Int32 userId, Boolean raiseEvents) at Umbraco.Web.Editors.ContentController.PostSave(ContentItemSave contentItem) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.

Displaying multinode picker within list of members

$
0
0

Hi Folks,

I've got a multinode picker as a custom data type within a member - I can't pull back the data to the front end as a list.

@foreach (var member in ApplicationContext.Current.Services.MemberService.GetAllMembers().OrderBy(member => member.Name))

{
            <tr> 

                <td>@member.Name </td> 
                <td>@member.Email</td> 
                <td>@member.GetValue("TownCity")</td>
                <td>@member.GetPropertyValue<IPublishedContent>("Pharmacy")</td>

            </tr> 

        }

I would think the last row should work but it's throwing an error - Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments

Not tried this before, so I'm a bit stuck. Any ideas will be greatly appreciated.

Cheers Darren

Custom application started events

$
0
0

Hi.

I have an application running on Umbraco 7.11, but I need to upgrade it to Umbraco 8 - awesome!

The thing is in Umbraco 7.* you have the possibility to hook events to the ApplicationInitialized/ApplicationStarting/ApplicationStarted from ApplicationEventHandler, but now that is gone.

Is there an equivalent in Umbraco 8?

Best regards Malthe

Using UmbracoHelper in a custom class in v8

$
0
0

Hi

Using the UmbracoHelper in a custom class or service etc., this syntax normally works in v7, but it fails in v8.

var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);

Is there a new way of doing this now in v8?

Best regards.

Forgotten Password from umbraco Back office

$
0
0

Forgotten Password functionality of the umbraco Back office gives 500 error. Following URL: /umbraco/backoffice/UmbracoApi/Authentication/PostRequestPasswordReset.

Please provide step for the forgotten password functionality of the umbraco backoffice.

Custom Property Editor with valueType JSON

$
0
0

Hi there,

I'm trying to implement a custom property editor in Umbraco 8. I know that the video on Umbraco.tv is outdated, but I still followed the instructions in

https://umbraco.tv/videos/umbraco-v7/developer/extending/property-editors/storing-complex-data/

and created my package manifest where I declared the valueType as JSON:

{
    propertyEditors: [
        {
            alias: "MyEditor",
            name: "myEditor",
            editor: {
                view: "~/App_Plugins/MyEditor/myEditor.editor.html",
                valueType: "JSON"
            }
        }
    ]
}

In the view I try to bind two inputs to their corresponding properties (ng-model="model.value.val1" and ng-model="model.value.val2"):

<input name="numberField1" class="umb-property-editor umb-number" type="number" ng-model="model.value.val1" />
<input name="numberField2" class="umb-property-editor umb-number" type="number" ng-model="model.value.val2" />

When I try to use this data type in the Umbraco backoffice, I get a Javascript error:

Cannot create property 'val1' on string ''

Does anyone know what changed in Umbraco v8 compared to v7 regarding custom property editors? Since the documentation is also not yet updated, I have no idea what's wrong here.

Thanks in advance for any help you can provide!

Cheers, David


Copy nested content between pages

$
0
0

Is it possible to make a copy of some nested content on one page and add it to another page?

For example, I have a large amount of nested content that needs translating from British English to US English but can't see any other way than manually recreating it.

Unable to open a css in Backoffice

$
0
0

If I click stylesheet i'm getting a this type of error.

× Server error: Contact administrator, see log for full details. Failed to retrieve data for child nodes undefined × {"errorMsg":"Failed to retrieve data for child nodes undefined","data":{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at umbraco.loadStylesheets.Render(XmlTree& tree)\r\n at Umbraco.Web.Trees.ApplicationTreeExtensions.TryGetXmlTree(ApplicationTree appTree, String id, FormDataCollection formCollection)\r\n at Umbraco.Web.Trees.ApplicationTreeExtensions.TryLoadFromLegacyTree(ApplicationTree appTree, String id, FormDataCollection formCollection, UrlHelper urlHelper, String currentSection)\r\n at Umbraco.Web.Trees.LegacyTreeController.GetTreeNodes(String id, FormDataCollection queryStrings)\r\n at Umbraco.Web.Trees.TreeControllerBase.GetNodes(String id, FormDataCollection queryStrings)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>cDisplayClass10.9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.

CachedPartial with V8

$
0
0

I might be missing something, but CachedPartial isn't playing well with multiple languages in Umbraco V8. Is there any additional key I need to set up if I:

a) don't want cachedpartial to be cached by page

b) I want it to be cached by language

This doesn't work (it displays wrong language):

@Html.CachedPartial("FooPartial", Model, 14400)

Deploying v8 app to Azure using Azure DevOps

$
0
0

Has anyone used Azure DevOps to deploy an Umbraco v8 application to Azure?

I can successfully deploy via Visual Studio, but DevOps only seems to copy over all the dlls to the target, no views or anything, and a zip does not get generated.

If anyone has managed this could they share the steps they took please?

The steps I have in the DevOps pipeline are

Build

Test

Deploy

Publish Symbols

Copy File to:

Publish Artifact

What I did notice is that I need a publish profile to successfully publish from Visual Studio, however I cant see where a profile should be included in Devops, unless it should be in the build arguments?

My current build arguments:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\"

I'm using the Visual Studio Build task

thanks

Robots.txt edit in CMS - URL rewrite to handle file extension?

$
0
0

Hi guys,

I'm building a site for a client who has quite specific requirements around being able to edit their Robots.txt file (amongst other things).

I've been following this really handy article by glcheetham https://glcheetham.name/2016/10/02/robotstxt-umbraco/

However I obviously come across issues when it comes to rewriting the URL to handle the file extension as UrlRewriting.config no longer exists.

Does anybody know of an alternative way to do this or better yet an IIS Rewrite rule I can use instead that will achieve the same result as this.

<add name="robots-rewrite" virtualUrl="^~/robots.txt" destinationUrl="~/robotstxt"/>

Apologies if this a simple query, my rewrite skills are not the greatest :)

Viewing all 72689 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>