Skip to main content

Posts

SQL to Find Umbraco v8 Nodes using a Certain Umbraco Document Type

A few years ago, I created this blog post to show how to find Umbraco v7 Nodes using a certain Umbraco Document Type.   I needed the same thing for Umbraco v8 projects, and below are some scripts that should help with this question. Find content pages that use a specific document type:  SELECT * FROM umbracoContent C INNER JOIN cmsContentType CT ON C . contentTypeId = CT . nodeId INNER JOIN umbracoNode N ON C . nodeId = N . id WHERE CT . alias = ' YourDocumentTypeAlias ' Find the latest published version of a content page by content page node id:    SELECT pt . alias , pd .* FROM umbracoPropertyData as pd INNER JOIN cmsPropertyType as pt ON pd . propertyTypeiD = pt . id INNER JOIN umbracoContentVersion as cv ON pd . versionId = cv . id WHERE cv . NodeId = 1055 and cv . [current] = 1
Recent posts

Practical Guide to SOLID Software Design Principles

SOLID software design principles are guidelines that help developers create more maintainable, understandable, and flexible code. These principles apply to any object-oriented design, and they aim to reduce the complexity of software development, making it easier to manage and scale.  The acronym SOLID stands for: Single Responsibility Principle (SRP): A class should have only one reason to change, meaning it should have only one job or responsibility.         Example: Instead of one class handling multiple responsibilities (calculating, printing, saving), each class has a single responsibility.        public class Invoice  {          public void CalculateTotal() { /* ... */ }     }       public class InvoicePrinter  {         public void Print(Invoice invoice) { /* ... */ }     }       public class InvoiceSaver  {         public void SaveToFile(Invoice invoice) { /* ... */ }     } Open/Closed Principle (OCP): Software entities should be open for extension

How to fix PowerShell script error: "The script is not digitally signed. You cannot run this script on the current system."

Every now and then, when I attempt to run a PowerShell script, I encounter the following error. This error prevents me from running the scripts necessary for tasks such as setting up a local development environment. PowerShell script error .\node-environment-setup.ps1 : File D:\git\repos\ProjectName\Website\ProjectName.Shared.Frontend\build_utilities\node-environment-setup.ps1 cannot be loaded. The file D:\git\repos\ProjectName\Website\ProjectName.Shared.Frontend\build_utilities\node-environment-setup.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + .\node-environment-setup.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : SecurityError: (:) [], PSSecurityException     + FullyQualifiedErrorId : UnauthorizedAccess A quick fix: Updating the ExecutionPolicy of the Process Scop

Fix for Azure Deployment Error: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC - (500) Internal Server Error.

If you see the following deployment error, it may be due to using a free app service plan and running out of space. To resolve this issue, you can delete old log files (via Kudu) or scale up your app service plan to a non-free option. Likewise, if you encounter "500 server error strict-origin-when-cross-origin" errors while loading elements such as your Umbraco backoffice, scaling up your free app service plan should also resolve this error. PS: These are misleading errors. Error: 2024-07-17T16:43:56.9791667Z ##[error]Error: Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC More Information: Could not connect to the remote computer ("project-name-uksouth-uat-202405-web-appservice.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERRO

How to generate an SSH Key to clone a Git repository using the SSH protocol

When you clone a remote repository using HTTPS, Git will prompt you for your username and password during the authentication process, on the other hand, when using SSH, Git uses your SSH key to authenticate, which means you don't need to send your credentials over the network.  Furthermore, SSH is a more secure method for cloning repositories, and working with the Git repos, as only the machines with the key file on disk can access these repositories. Even if the SSH key file was to be stolen, it wouldn't give access to the account itself (unlike the credentials) and can be easily revoked.  Creating an SSH Key To generate a new SSH key, open up your terminal app, i.e., Git Bash, and type the following; AzureAD+NurhakKaya@WAT607 MINGW64 / $ cd .ssh/ AzureAD+NurhakKaya@WAT607 MINGW64 /.ssh $ ls id_rsa  id_rsa.pub AzureAD+NurhakKaya@WAT607 MINGW64 /.ssh $ ssh-keygen -t rsa -b 4096 -C "[email protected]" Generating public/private rsa key pair. Enter file in

Umbraco CMS kaynak koduna katkı için gerekli adımlar

Dün Umbraco Türkiye grubu olarak yaptığımız bir toplantıda , Umbraco CMS kurulumu sırasında bir hata görmüştük, bugün hatayı inceleme şansım oldu ve çözümü ile ilgili küçük bir makale yazdım . Umarım faydası olur.  Bu arada Umbraco CMS'ye kod katkılarınız için izlemeniz gereken yolu da kısaca hatırlatayım yine; GitHub 'a giriş yapın (GitHub hesabınız yoksa ücretsiz hesap oluşturabilirsiniz.) Umbraco-CMS GitHub kaynak koduna gidin  ve "Fork" tuşuna basarak kaynak kodunu kendi GitHub hesap alanınıza kopyalayın.  Eğer daha önce "Fork" işlemini yaptıysanız, kendi GitHub Umbraco-CMS alanınızda "Sync fork" tuşuna basarak son kod değişikliklerini kopyalayın. Kendi GitHub hesap alanınızdanki Umbraco-CMS projesine gidin ve "Clone" işlemine "Clone" linkini kopyalayarak başlayın, örneğin Code>Clone>HTTPS linkini kopyalayın. Projeyi kendi makinenize klonlayın. (git clone ...) Umbraco projesinin derlemek için Node.js son versiyonuna i

How to fix Umbraco CMS Build Error NU1104: Unable to find project '..\Umbraco-CMS\tools\Umbraco.Core\Umbraco.Core.csproj'.

Yesterday during an online meeting , I was talking about how to contribute to Umbraco CMS . As part of this talk, in order to set up my local Umbraco CMS project ,  I cloned the latest Umbraco.CMS code to my local machine, but when I built it I saw the following error: Error NU1104 Unable to find project ' D : \git \repos \Umbraco -CMS \tools \Umbraco .Core \Umbraco .Core .csproj ' . Check that the project reference is valid and that the project file exists . Umbraco .JsonSchema D : \git \repos \Umbraco -CMS \tools \Umbraco .JsonSchema \Umbraco .JsonSchema .csproj I was surprised to see this error as I did the exact same thing a couple of days ago and saw no problems.  After trying a few things, I checked the Umbraco.JsonSchema project's project references and realised that Umbraco.Core project reference was broken.  After removing Umbraco.Core from the Umbraco.JsonSchema and adding it again fixed the problem and I could then do my local database setup as normal.