Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Vary by culture" toggle missing for properties on document type #17111

Closed
gab-trifork opened this issue Sep 23, 2024 · 11 comments
Closed

"Vary by culture" toggle missing for properties on document type #17111

gab-trifork opened this issue Sep 23, 2024 · 11 comments
Labels
state/needs-more-info We don't have enough information to give a good reply type/bug

Comments

@gab-trifork
Copy link

gab-trifork commented Sep 23, 2024

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

14.2.0

Bug summary

When configuring properties on a document type, the toggle to allow properties to vary by culture is missing.

(Downgrading to 14.1.2 makes the toggle come back)

Specifics

No response

Steps to reproduce

Set up a blank Umbraco project using dotnet new umbraco and follow the steps for adding culture varied content:
https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/variants

When on the step To allow a property on the Document Type to be varied it will have to be enabled for the property: notice that there is no toggle for enabling "vary by culture" for the property.

Expected result / actual result

The toggle is there, letting me decide whether properties are variant or invariant

Copy link

Hi there @gab-trifork!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@iOvergaard
Copy link
Contributor

Hi @gab-trifork, this issue is serious, but I'm having difficulty reproducing it. The toggle should be shown as long as the document type itself is also marked as "Allow vary by culture" in the "Settings" tab:

image

Will you let me know if that works, please?

@iOvergaard iOvergaard added the state/needs-more-info We don't have enough information to give a good reply label Sep 24, 2024
@gab-trifork
Copy link
Author

Hello @iOvergaard

I have that enabled.
prop
doc type

@gab-trifork
Copy link
Author

Sorry, I have 2 Umbraco projects and it turns out I accidentally ran the incorrect one, generating a new project using dotnet new umbraco is in fact NOT enough to reproduce. I am trying to figure out where it is going wrong.

@iOvergaard
Copy link
Contributor

Good and bad news at the same time, @gab-trifork. Do let me know what you figure out!

@gab-trifork
Copy link
Author

gab-trifork commented Sep 24, 2024

@iOvergaard

Okay, so I have managed to do a minimal reproduction.

  1. dotnet new umbraco
  2. dotnet add package usync.complete
  3. dotnet run
  4. theres no vary by culture on the property

if you stop the server and delete the usync package again, the toggle will reappear

my deps:

<ItemGroup>
  <PackageReference Include="Umbraco.Cms" Version="14.2.0" />
  <PackageReference Include="uSync.Complete" Version="14.2.0" />
</ItemGroup>

@iOvergaard
Copy link
Contributor

@gab-trifork great, I can certainly reproduce that. Thank you so much for the reproducible steps.

The variation toggle is gone when usync.complete is installed, and when you remove usync.complete and restart the server, it reappears. It's difficult diving into minified code coming from other libraries to see where it goes wrong. Still, I could see that they make more contexts available in the document type editor and I think they might be overriding some of the built-in services in that area.

usync.complete 14.2 was just released last week and this bug might have flown under their radar until now. Honestly, I would report it directly to them on their Github issues tracker and refer back to this thread.

The technical explanation is as follows: The UI component needs to know that the context bearing the token UMB_CONTENT_TYPE_WORKSPACE_CONTEXT has an observable property called variesByCulture which gets set when you activate the corresponding toggle in the "Settings" tab in normal circumstances. Otherwise, the variation toggle won't show up for properties.

@gab-trifork
Copy link
Author

@iOvergaard
Thanks for the quick responses, and sorry for the inconvenience - had I noticed it only happened with uSync I would have opened the issue there instead.

@iOvergaard
Copy link
Contributor

It's fine, @gab-trifork. Cheers!

@KevinJump
Copy link
Contributor

Hi,

We've tracked this down in the uSync.Complete code, for reference (and maybe as a place to look if it happens with someone else). we had a missing condition.

as in we had a workspace context manifest that didn't limit the workspace context by condition.

const context: ManifestWorkspaceContext = {
	type: 'workspaceContext',
	alias: 'usync.publisher.server.workspace.context',
	name: 'Publisher workspace context',
	js: () => import('./server-workspace.context'),
};

we added the correct condition and that fixed is.

const context: ManifestWorkspaceContext = {
	type: 'workspaceContext',
	alias: 'usync.publisher.server.workspace.context',
	name: 'Publisher workspace context',
	js: () => import('./server-workspace.context'),
	conditions: [
		{
			alias: 'Umb.Condition.WorkspaceAlias',
			match: USYNC_PUBLISHER_SERVER_WORKSPACE_ALIAS,
		},
	],
};

the context itself is not doing anything 'suspicious' (not from my eyes anyway). so not 100% sure why it breaks this and only this bit of the datatype but that does look like what it was doing 🤷

@iOvergaard
Copy link
Contributor

Hi @KevinJump

I'm amazed by your investigation skills - great find. I'm not sure why that would have an effect, but I did see the publisher* contexts (by placing a <umb-debug> element in there in the browser) in the property create/edit dialog coming out of usync alongside the document type context from the Umbraco core. I didn't think they would take precedence for this property. Thanks for getting back to us with your findings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/needs-more-info We don't have enough information to give a good reply type/bug
Projects
None yet
Development

No branches or pull requests

3 participants