Umbraco 14 Bug and testing NextJs Umbraco Demo

Posted written by Paul Seal on September 06, 2024 Umbraco

I started the day by going through the issues I had previously raised on the Umbraco Issue Tracker in GitHub to see if any of them have been fixed and to see if I can add any more information to them.

I helped someone in the Umbraco Community who was struggling with getting their Umbraco Dashboards to show in the right order. The weight property wasn't having the right effect so I sent them some code to remove their dashboards and add them back in the correct order.

using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Dashboards;

namespace Codeshare.Composers;

public class DashboardsComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.Dashboards().Remove<MyDashboardOne>();
        builder.Dashboards().Remove<MyDashboardTwo>();
        builder.Dashboards().Add<MyDashboardOne>();
        builder.Dashboards().Add<MyDashboardTwo>();
    }
}

DashboardsComposer.cs

I also helped someone when they asked if I knew how to rebuild examine indexes from code.

I looked at how Kevin Jump does it in uSync.Commands and found that he uses a service from Umbraco

using Umbraco.Cms.Infrastructure.Examine;

private readonly IIndexRebuilder _rebuilder;

if (_rebuilder.CanRebuild(index))
{
    _rebuilder.RebuildIndex(indexName);
}
else
{
    //do what you want
}

Using IIndexRebuilder to rebuild indexes

After this I tested out Umbraco 14.2 to see if it is working better these days. 

I found a new bug and raised an issue for it.

Finally I tested out the Next.js Umbraco Demo from Kenn Jacobsen

It was great to have a demo Umbraco site with content already there, and some steps to follow to create a Next.js site and have it read the content from the Umbraco site. It worked great.

The demo even lets you see preview content. #h5yr Kenn