https://discord.umbraco.com
Join Discord
AmbientContext error when trying to use ConentService within a Hangfire task
w

Wiggy

over 1 year ago
Has anyone come across this error before?
System.AggregateException: One or more errors occurred. (No AmbientContext was found.) ---> System.InvalidOperationException: No AmbientContext was found.    at Umbraco.Cms.Infrastructure.Scoping.AmbientScopeContextStack.Pop()    at Umbraco.Cms.Infrastructure.Scoping.ScopeProvider.PopAmbientScopeContext()    at Umbraco.Cms.Infrastructure.Scoping.Scope.<>c__DisplayClass100_0.<RobustExit>g__HandleScopeContext|2()    at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)    --- End of inner exception stack trace ---    at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)    at Umbraco.Cms.Infrastructure.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)    at Umbraco.Cms.Infrastructure.Scoping.Scope.DisposeLastScope()    at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()    at Umbraco.Cms.Infrastructure.Examine.ExamineUmbracoIndexingHandler.DeferedReIndexForContent.<>c__DisplayClass6_0.<Execute>b__0(CancellationToken cancellationToken)    at Umbraco.Cms.Infrastructure.HostedServices.QueuedHostedService.BackgroundProcessing(CancellationToken stoppingToken)
Trying to run a Hangfire task to update a node with the ContentService. Have tried a million things regarding scopes etc.
w
s
j
  • 3
  • 41
  • 194
Get CMS Culture
y

Yasein H. Burqan

almost 2 years ago
How can I Get CMS Culture by code? I want to get the current language that is the user work in by C# like : if user work on English get English if user work on French get French ...etc ?
y
r
j
  • 3
  • 8
  • 194
Retrieving multiple content types with the delivery api (newbie question)
u

_tommadden

about 1 year ago
TLDR; is there a content delivery api cheatsheet (not the docs) like Seb did back in the Razor days? I'm struggling how to find the best way to get a page and it's children (for a listing page) in a single api call. I can see how to get the children on their own. In my case I have a content type for the listing page and one for the child types, so I thought I'd try that way, but I can't figure out how to pass in multiple types. I've tried reading the docs and tried several ways to do this in Swagger, but with no success. My last resort will be to get all content and restrict the fields I return, but I thought I'd check for a 'better' way of doing this. Thanks
u
s
b
  • 3
  • 3
  • 193
How do i authenticate to the Content Delivery API with Swagger or Postman
n

Navorski

over 1 year ago
Can someone help me on my way? I created an API, an UmbracoApiController, with the [UmbracoMemberAuthorize] attribute. I Configured swagger to be able to authorize Everything seems to be in place and to work. But how do i authenticate with Swagger, or with Postman, or whatever? when i go to https://localhost/umbraco/swagger, i can see the swagger api, and when i want to authenticate, i have to fill in a client_id and a client_secret. But i have no idea where to get those? https://cdn.discordapp.com/attachments/1242595241077375058/1242595241219850310/image.png?ex=664e687f&is=664d16ff&hm=725f3c4adc068b9f71b6a1a0688cf566f11aabbd9de24c86de6bb9a52b3f319d&
n
d
+2
  • 4
  • 8
  • 191
Not sure how to use umb-table
m

mz10ah

almost 2 years ago
Hi, I am wondering how to get the select all box working as by default, its marked and I can't even get it unchecked. Also the sorting/unsorting isn't working either. Now I am sure I need more code than what I have copied from the API doc but if anyone could guide me a bit here, that would be appreciated. Here is my code:
html
<umb-table
                  ng-if="vm.items"
                  items="vm.items"
                  item-properties="vm.options.includeProperties"
                  allow-select-all="vm.allowSelectAll"
                  on-select="vm.onSelect"
                  on-click="vm.onClick"
                  on-select-all="vm.selectAll"
                  on-selected-all="vm.onSelectedAll"
                  on-sorting-direction="vm.onSortDirection"
                  on-sort="vm.onSort"
               >
               </umb-table>
js
vm.onSelect = onSelect;
      vm.onClick = onClick;
      vm.selectAll = selectAll;
      vm.onSelectedAll = onSelectedAll;
      vm.onSortDirection = onSortDirection;
      vm.allowSelectAll = true;
      vm.onSort = onSort;

      function selectAll($event) {
         alert('select all');
      }

      function onSelectedAll() {
         return true;
      }

      function onClick(item) {
         console.log('clicked', item);
         alert('click node');
      }

      function onSelect(selectedItem, $index, $event) {
         alert('select node');
      }

      function onSortDirection(col, direction) {}

      function onSort(field, allow, isSystem) {}
https://cdn.discordapp.com/attachments/1194969651894026330/1194969652032454696/0.png?ex=65b24936&is=659fd436&hm=94008e1a22d39aaa6f174c0e44d1e42cb625daacaafafae0e336b475fc233165&
m
j
  • 2
  • 8
  • 191
[Solved] PDF Generator
c

Craig100

over 1 year ago
Is there a decent PDF generator for Umbraco that works with V13? I've tried the WebWonders one but it won't install and looks like it hasn't been updated in a long while.
c
d
+5
  • 7
  • 83
  • 190
[SOLVED] Multiple External Member Login Providers in .Net Core (v12)
a

andyc

about 2 years ago
I've been trying to get a v12 site working with multiple Azure AD accounts (something that's been running fine for years on v7) but I've hit a wall. Works fine with one and I can trigger the SSO process for more than one but the postback from the provider always fails for any provider but the first one. I suspect this is something to do registering the schemes in a certain way but can't find any helpful documentation. I know this is possible I just seem to be missing something. Among other things, I've tried adding multiple
builder.AddMemberExternalLogins()
and also multiple
memberAuthenticationBuilder.AddOpenIdConnect
within that and they both throw
Exception: Unable to unprotect the message.State
Any ideas?
a
d
  • 2
  • 9
  • 190
Programmatically creating block list items, and saving to page
l

Lewis Heaton

over 1 year ago
I have a page in Umbraco 13, i'm trying to create a few block list items, then save this to the page. The page is being generated fine when i comment out the setValue for setting the block list item. I found a our.umbraco post from 2020, which pointed to https://github.com/umbraco/UmbracoDocs/blob/e64ec0e5b28b4e5a37b7865691621e45dd82701f/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Block-List-Editor/index.md which is what i followed. Any docs / suggestions on how to get this working?
l
d
  • 2
  • 7
  • 189
Get ID's of all published pages?
b

Bodie

almost 2 years ago
In Umbraco 13, is there an way, (possibly via the Content API?) to get a list of all published nodes? For example (1003,1008,1018,1019) etc.
b
s
c
  • 3
  • 7
  • 185
How do i use a custom model in an Umbraco page?
t

TigerMan

almost 2 years ago
I have an Umbraco Document Type and a template with the same name. I create a page in Umbraco and can view the page with the details entered. On this page i now would like to build a form so it can be submitted. As soon as i declare the model in the top of my cshtml file, i get an error about the ViewData (ViewDataDictionary) is of type X but this method requires Y. How am i supposed to set this up so both the content from Umbraco work and my custom form would work?
t
a
s
  • 3
  • 2
  • 185
Previous121314Next

Umbraco

A hub and casual space for you to interact with fellow community members and learn more about Umbraco!

Powered by