it's odd. I uninstall uSync, then the labels displ...
# package-development
l
it's odd. I uninstall uSync, then the labels display correctly - reinstall it, and it shows the keys again
k
So i have this in the csproj.
Copy code
<ItemGroup>
        <PackageReference Include="Our.Umbraco.Community.Contentment" Version="4.0.0-alpha004" />
        <PackageReference Include="Umbraco.Cms" Version="10.0.0-rc4" />
        <PackageReference Include="uSync" Version="10.0.0-beta1" />
    </ItemGroup>
and uSync doesn't put any files in the project (besides the uSync/v9 folder for the files).
(thats because they are static assets coming from the .nuget cache)
l
ok, I do have an App_Plugins/uSync folder on disk. I can't recall if I copied it from my v9 demo site, or somewhere else. I'll try clearing that out, and reinstalling
...and I'm defo on
10.0.0-beta1
k
yeah - in the beta1, a dotnet clean doesn't remove that folder. - in the next rc (just haven't published it yet) we've left that target stuff in so a
dotnet clean
will remove the old
app_plugins/uSync
folder
it might be - i have noticed that if you add a manfiest via code, and their is already a manifest from disk with the same 'packageName' it doesn't like it - might be that
p
works nicely for me, i have both usync and contentment keys in
/umbraco/LocalizedText
l
I've just tried removing the
App_Plugins/uSync
folder, uninstalling/reinstalling uSync ... but not getting Contentment's localizations
k
do you get the uSync ones ? or do you get neither ?
l
the uSync dashboard/tree panel all appears to render fine, no localization keys
just to note, with the "manifest in code" you mentioned, I'm not doing that on Contentment - only using the
package.manifest
@p-m-j Thanks for confirming. I'm very confused why this isn't working on my set-up. I'll keep tinkering.
p
makes sense you have a App_Plugins directory on disk, usync is doing the RCL thing
OK i can repro from fresh install of RC4 via templates
right, if i relaunch it works
so on first launch of site only usync is there, second time both are there
l
reboot, meaning stop/restart the web-app?
p
probably targets related
in contentment
k
I wonder if that is to do with the FileProvider that loads the 'old' app_plugins ? - the PR uses the Combined FileProvider to read all the App_Plugin locations ? - maybe on first boot the other one isn't read in that provider ? this theory may be complete tosh
l
hmm, I've restarted the web-app several times, and it's the same thing. With uSync installed = no Contentment localizations. Then uninstall uSync, localizations are there. 😬
I'm not 100% on what I'd need to do about this? Targets meaning dotnet copying files from the nuget pkg to the webapp?
p
aye but I don't think it is that as I can nuke app_plugins and re-run and everything is fine. will try repro again
1. Fresh project via dotnet new templates 2. Launch site with
dotnet run
perform install 3. Stop site added package ref for contentment 4. Launch site with
dotnet run
confirm contentment keys in /umbraco/localizedtext 5. Stop site added package ref for usync 6. Launch site with
dotnet run
and only keys for usync show in /umbraco/localizedtext, contentment missing. 7. Stop site 8. Launch site with
dotnet run
and keys show for both packages.
l
Thanks. I'll give those steps a run through now 👍
p
interestingly if I do same thing with Umbraco.Web.UI instead of new project i get the following
Copy code
System.NotSupportedException
  HResult=0x80131515
  Message=EntityType "dictionary-item" does not have a matching UmbracoObjectType.
  Source=Umbraco.Core
  StackTrace:
   at Umbraco.Cms.Core.UdiEntityTypeHelper.ToUmbracoObjectType(String entityType) in C:\Users\Paul Johnson\Dev\umbraco\v10\src\Umbraco.Core\UdiEntityTypeHelper.cs:line 100
   at uSync.Core.uSyncObjectType.ToUmbracoObjectType(String entityType)
which may be one for @Kevin Jump to look into, otherwise outcome is same, contentment only, usync only, both
so first time usync is added for me I get that exception and localizedtext is wrecked for other packages, nothing about it in logs so i guess it's swallowed somewhere (but then I guess this could also be absolutely nothing to do with anything)
l
Okay, ran though your steps - I get the exact same outcome! 💯
p
gonna quit and become a QA 😄
l
my concern is that when I run from Visual Studio, it's basically step 6 every time. Which is probably related to some build/targets thing happening each time. (I'm guessing here)
Okay, started digging and found that if I put the Contentment lang files in
wwwroot/App_Plugins/Contentment/Lang
then it will work every time! From looking at umb core code, appears to be from here: https://github.com/umbraco/Umbraco-CMS/blob/release-10.0.0-rc4/src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs#L45 should that be using
webFileProvider
or
contentFileProvider
to scan the App_Plugins folder?
(I appreciate that it's the end of UK work day - I'm downing tools myself now too)
p
there's some composite file provider magic going on here to get ~/App_Plugins into the webroot provider https://github.com/umbraco/Umbraco-CMS/blob/4238e2a4f3a418c8d8cb68f8efdc59b83ce768d8/src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs#L133
k
ahh build.ps1 has gone ? - how do i build a local nuget package of the source now ?
p
just
dotnet pack umbraco.sln -o dist
only thing it won't do for you is update the default version in Umbraco.Templates config/template.json
l
Thanks, (today I learnt! 😆)
So after all this, I'm unsure if I need to do anything to my Contentment pkg? I'm still experiencing the missing localizations on my demo site (that is part of the pkg's GitHub repo - using uSync to restore the CMS/data-types). This seems to be when I run it from Visual Studio (not
dotnet run
) - which is pretty much my dev workflow, for debugging, etc. If I don't need to do anything - I'm wondering what I say to folks who discover the same issue and think it's Contentment's bug/fault. Feels like my options are to put the lang files in wwwroot (I'd like to avoid that), or remove the lang files and have hardcode labels (it's not like ALL of my pkg is localized anyway 😆 ) 🤷
(forgot to add, RCL isn't an option at the moment, as I'm still multi-targeting with v8)
p
it works in visual studio if usync isn't referenced I think you said? How about another non usync rcl that adds a language file.
l
I'm happy to try it - not that I know of another package that's doing RCL
p
the best one to test against would be a demo one, just an RCL that sets staticassetsroot the same way usync does and has a folder ~/Lang/foo.xml
l
(that's correct btw, with uSync uninstalled, Contentment's langs are there)
Okay, I haven't looked at RCLs at all yet, kinda feel a rabbit hole ahead 😆
p
if it's broken with a demo RCL then it's probably a problem in umbraco with nice steps to repro
l
just found that @Kevin Jump has another pkg that does RCL (Styled Textbox) ... I'll give that a go. (I searched GitHub for
StaticWebAssetBasePath
and Umbraco 😆 )
this one is a good candidate, only thing in it is a single localization file
l
Thanks Paul, very much appreciated! 🙏
p
no problemo, but you should totaly have a go with them when you get a sec, it's nice not having to mess about with targets to make plugins work
l
Tested out your test pkg, and it works as expected - langs for both packages are in the LocalizeText API request. 👍 (and my Contentment labels display correctly). (Turns out the Styled Textbox pkg didn't have a lang folder - which worked fine, just not an accurate test here) I'm unsure whether it's a uSync + Contentment combo, or something else - at this point I don't think it's Umbraco. I'll park this for now, as not sure what else to do, thanks for your help on it @p-m-j!
p
> at this point I don't think it's Umbraco phew 😄
k
Yeah i am going to take a good look at this - been at a funeral today 😢 so not really had the head space - but its prob uSync (v-likely) causing something in that PR i wrote (again likely) to fail and not carry on loading other stuff. I will get my debugging trousers on tomorrow !
p
sorry for your loss Kevin
k
thanks.
Some progress, its a uSync thing (at the moment) not sure if it needs mitigation should something else do it...
When uSync starts up - if there is no uSync folder - it does an export in UmbracoApplicationStarting, and something deep inside this triggers the LocalizedTextSources to be loaded, when they are loaded at this point only the RCL ones seems to be found. e.g
(i added the extra logging) .
I am guessing - 1) uSync needs to do this on ApplicationStarted not ApplicationStarting (started wasn't in 9.0 so thats why i think we did it that way).
or - the App_Plugins File provider handler needs to be loaded sooner in umbraco ?
the problem is the Localized text is cached so once loaded its not refreshed so if anything triggers it before the FileProvider is complete this is the result ?
Hi @leekelleher & @p-m-j do you want to try this with the a new version of uSync i think that 'fixes' it - but i am a bit worried that there is a use case where Umbraco can still break here. https://www.nuget.org/packages/uSync/10.0.0-rc5
p
i'd love a reason to procrastinate further from codegarden prep but best not today 😄
k
😄 yeah i still have to finish my talk, but given it has a whole bit of RCL in it, thought best check it actually worked
p
switching from starting -> started for your export should fix it by the sounds of things
k
It does for me 🤞 -~~ I think in Umbraco terms if the registration of
UseUmbracoPluginStatic
files was moved up above the
UseUmbracoCoreMiddleware
then anything triggering this early wouldn't cause this issue because the file provider would be loaded ?? https://github.com/umbraco/Umbraco-CMS/blob/v10/contrib/src/Umbraco.Web.Common/ApplicationBuilder/UmbracoApplicationBuilder.cs#L105~~ edit: yeah that doesn't change anything on that side of things .
I have also put a PR into Umbraco - just because i think this is an easy thing for a dev to stumble into and a hard thing to actually debug and work out what is happening. and we can "fix" it with an extra directory trawl. https://github.com/umbraco/Umbraco-CMS/pull/12552
p
Is de-duplication already handled, presumably you could pull the same xml from both providers
k
It is, in the service when it reads in the xml it sorts out any duplicate values
l
Kev, I'd been offline today - I'll give it a test tomorrow 👍 (Sorry to hear about yesterday's funeral, sending love)
uSync 10-rc5 resolves the LocalizedText issue I was experiencing! 🎉 🌟 Thank you @Kevin Jump
k
Woot
l
Hope it's not been too much of a headache to investigate and resolve.