https://discord.umbraco.com
Join Discord
Custom NPOCO database connection... is this a sane approach?
j

Jason

over 1 year ago
I guess this is only tangentially related to Umbraco but the NPOCO docs are a bit sparse and it's not the most popular library in the world. I'm hoping some other lovely Umbracians have experience with this. I've inherited a project I'm upgrading to v13 which uses NPOCO to connect to a different database to Umbraco. From what I can piece together across GitHub comments and Stack Overflow, it looks like the right way to use it is to instantiate and dispose the database object with every request - and rely on .NET's connection pooling to take care of perf... can anyone confirm if this approach is OK?
csharp
private IDatabase GetDatabase() => 
    new Database(ConnectionString, DatabaseType.SqlServer2012, SqlClientFactory.Instance);

public async Task<IEnumerable<vessel>> GetAll()
{
    using var database = GetDatabase();

    return await database.FetchAsync<vessel>("SELECT * FROM " + TableName + " ORDER BY Vessel");
}

//... other repository methods
j
l
  • 2
  • 1
  • 133
Can you Increase Log File Size Limit?
d

Dan 'Diplo' Booth

over 1 year ago
If you try and view the Umbraco / serilog files that are above a certain size you get the message: "Today's log file is too large to be viewed and would cause performance problems." So is there a way I can decide how big is too big? I've a powerful desktop with 12 cores / 32GB RAM so I'm pretty sure it would be OK with a larger size. When you are doing stuff like trace-level logging it can easily fill up and trying to read a JSON log file in Notepad++ isn't fun... So can we increase the threshold? How? Alternatively, are there any offline log viewers (eg. stand alone app)? I remember someone wrote one once, but was that for the older log files?
d
k
+2
  • 4
  • 19
  • 133
Hiding the ‘Save’ button in the back office.
r

Rich G

over 1 year ago
Is there a way to hide the Save button in the back office? We’re are running headless and I want to hide the ‘Save’ button and change the text of the ‘Save and Publish’ to ‘Save’ as we deal with publishing separately via a dashboard. Any ideas? Happy just to hide it with CSS (tried some code samples but couldn’t get this to work) or via code. Using latest Umbraco 13 latest Thanks
r
k
  • 2
  • 3
  • 132
Best practise: restart after deployment?
d

Domitnator

over 1 year ago
Hi Everyone, We are deploying our Umbraco 13 website to Microsoft Azure (as a App Service on Linux) which works perfectly well right now. But, i am wondering if i should restart the application after the deployment. I heard some people say this would be wise because of some rare caching issues, but is this still the case for Umbraco 13? I'd rather not restart the application as this takes time (i know i could tackle this with deployment slots). We do use uSync and Azure Blob Storage. What are your toughts on this topic?
d
d
+3
  • 5
  • 10
  • 132
How to find the problem block?
m

Matt Wise

about 2 years ago
When saving and publishing (I have far too many content nodes to know which one, as its part of a migration) Is there a way I can debug to find the source of this: Error occurred executing workItem. Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Umbraco.Cms.Core.Models.Blocks.BlockValue'
m
d
  • 2
  • 7
  • 132
uSync Vs Umbraco deploy
t

TigerMan

over 1 year ago
Hi all We're looking into a deployment solution for Umbraco, Umbraco Commerce to Azure. Both of these products seem to come across as being compatible.... Umbraco deploy seems very expensive but uSync seems to do the same but at a cheaper price. Does anyone have experience with these products and any disadvantages before we could make a decision?
t
k
+3
  • 5
  • 7
  • 130
Reinstall Umbraco 13 instance
c

CaptTaifun

about 1 year ago
I have an Umbraco 13 instance and would now like to reinstall it (i.e. set up a new database). I have deleted the SQLite database and the “ConnectionStrings” section from all appsettings.json files. When I now run Umbraco, I only get “Boot Failed”. And in the log file: System.InvalidOperationException: The factory has not been configured with a proper connection string.\n at Umbraco.Cms.Infrastructure.Persistence.UmbracoDatabaseFactory.Initialize()\n at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock What else do I have to do to recreate the database/reinstall the instance?
c
h
+4
  • 6
  • 8
  • 129
Delivery Api with Jwt Authentication
k

Khattab

over 1 year ago
I am building a headless Next website that will consume the content delivery api to render the content curated in Umbraco, the Next web app is secured with OpenId and users login to the web app and acquires an access token that will be used to communicate with Umbraco, we have configured Jwt for Umbraco and we can resolve the users when requesting Umbraco resources, the issue we are trying to solve is securing the content delivery api, according to the documentation the only way to authorize users users to consume the content delivery Api is by acquiring another token from Umbraco which acts as an identity provider, given the nature of Jwt middleware when I try to execute an authorize request with the token passed from the Next web app I receive the the client_id is empty, this is true because Jwt configurations doesn’t have a client id, also there will be now auth flow to authenticate against as the user authentication flow is already executed at the frontend side, when I checked the base delivery controller I found that it’s decorated with an Authorize filter that requires a policy that mandates that only token issued by the OpenIddict schema. So my question is there a way to go around this or extend the Api to allow requests issued by my custom Jwt scheme as well?
k
a
  • 2
  • 6
  • 129
error CS0246: The type or namespace name could not be found
w

webjaved

over 2 years ago
Hello, I am getting the following error message;
error CS0246: The type or namespace name 'FeaturedItemsRow' could not be found (are you missing a using directive or an assembly reference?)
Here is the featuredItemsRow.cshtml component file. https://prnt.sc/_gBCXnfJaxwi Here is the block selected as part of my page builder block. https://prnt.sc/p_MqFGvF2X_H I'm working on Umbraco Cloud at the moment but will look at getting the project cloned locally now that I have access to do so.
w
j
  • 2
  • 5
  • 128
Getting UmbracoHelper in class
t

TigerMan

over 1 year ago
Hi all I'm using the below code in Umbraco 13 custom class public IPublishedContent GetProductById(int id) { var accessor = StaticServiceProvider.Instance.GetRequiredService(); if (accessor.TryGetUmbracoHelper(out var umbracoHelper)) { return umbracoHelper.Content(id); } return null; } This returns the error InvalidOperationException wasn't able to get an UmbracoContext. When searching on this error, most lead me to Umbraco 9 bugs so wondering if I'm missing something?
t
d
  • 2
  • 8
  • 127
Previous202122Next

Umbraco

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

Powered by