Drupal Version

10.x

Domain module version

2.x

Problem/Motivation

I have a site with content translation enabled. field_domain_access is configured as untranslatable. Each translations of entity should have the same assigned domains. The untranslatable fields are hidden (untranslatable_fields_hide) on the entity translation form. I have multiple editors with different domain assignments. It not possible to save the translations unless the editor has the same domain assignments as the content entity.

It occurs an entity validation error during entity save. Content Translations sets the domain fields to #access => FALSE in \Drupal\content_translation\ContentTranslationHandler::entityFormSharedElements. This happens after the domain_access_form_node_form_alter. I tried to change the order by converting it to a #process callback.

Expected Behavior

Domain Access field is hidden, existing values are kept as is.

Actual Behavior

Steps to reproduce

Issue fork domain-3367186

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

webflo created an issue. See original summary.

webflo’s picture

StatusFileSize
new4.48 KB
webflo’s picture

Status: Active » Needs review
webflo’s picture

StatusFileSize
new7.79 KB

#2 contains the test-only patch.

The last submitted patch, 2: 3367186-2-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

webflo’s picture

StatusFileSize
new7.95 KB

Fixes fatal error on config entity forms.

agentrickard’s picture

Nice -- even a test update.

I would like to see a comment on `function domain_access_module_implements_alter()` that indicates what we are doing (and why),

xavier.masson’s picture

StatusFileSize
new7.66 KB

Rerolled the patch to apply cleanly against the latest codebase. No changes were made to the patch's logic or functionality.

alexrayu’s picture

StatusFileSize
new7.53 KB

Here is a rerolled patch from xavier.masson, applying to beta2.

mably’s picture

Status: Needs review » Needs work

Could you create a MR please?

mably’s picture

Status: Needs work » Needs review
Issue tags: +next-release

Looks like an interesting feature to have for next release.

MR created on latest 2.0.x. Tests are all green.

Could someone give me a RTBC please?

mably’s picture

Status: Needs review » Needs work

Looks like the MR needs some cleanup.

mably’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -next-release

Not sure to really understand what this MR is doing and why.

Some explanations are needed before merge.

mably’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +next-release

Ok, finally got to understand every part of it. We should be ready for merge.

The domain_access_module_implements_alter hook didn't solve the problem for me.

Had to increase the module_weight to make it work.

Could we have some RTBC please?

  • mably committed 7ada4894 on 2.0.x
    Issue #3367186 by webflo, xavier.masson, alexrayu, mably: Domain Access...
mably’s picture

Status: Needs review » Fixed
Issue tags: -next-release

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • mably committed 8118e1c8 on 3.x
    Issue #3367186 by webflo, xavier.masson, alexrayu, mably: Domain Access...
emircan erkul’s picture

@mably thank you for the update.

Can i learn why service naming change always? https://git.drupalcode.org/project/domain/-/blob/3.0.0-alpha4/domain_con... vs https://git.drupalcode.org/project/domain/-/blob/3.0.0-alpha3/domain_con...

Asking because I have one dependent module, need to switch again and again

mably’s picture

@emircan-erkul thanks a lot for the catch!

This was a nasty tagging bug on the 2.0.x branch.

Problem fixed with 3.0.0-alpha5.

mably’s picture

If needed, I'm available for discussion on the #domain channel of the Drupal.org Slack.

emircan erkul’s picture

Thank you, appreciate it

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.