Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I un publish a particular translation, entire node got unpublished
Comment | File | Size | Author |
---|---|---|---|
#9 | 2825419-translation-9.patch | 3.31 KB | agentrickard |
#8 | 2825419-translation-8.patch | 3.25 KB | agentrickard |
Comments
Comment #2
agentrickardI need a proper, repeatable report please.
* What modules do you have installed?
* What steps did you take to produce the behavior?
* Why do you suspect Domain as the cause?
Please see the submission guidelines at https://www.drupal.org/issue-queue/how-to
Comment #3
nijinanijil CreditAttribution: nijinanijil commentedHi,
I am also facing the same issue. Un publish translation option was working until I set up domain access. When you un publish a particular translation the entire node get un-published after setting up domain access.
Thanks
Nijil
Comment #4
nijinanijil CreditAttribution: nijinanijil commentedSteps to reproduce
Scenario 1
1) Install multi lingual module and add an additional language say 'ja'
2) Create an article and publish -- en version is published
3) Add translation for article and un publish -- ja version is un published. All works till here
4) Install domain access module. Rebuild content permissions
5) Access both the translations you can see both will show access denied
Scenario 2
1) Edit both the translations and un publish both.
2) Edit and Publish one of the translation. Both the translations will be available for guest users, even though one is published and one is un published.
Scenario 3
1) Edit both the translations and publish
2) Edit and un publish one of the translation. Both the translations will not be available for guest users
The value in the 'status' filed for both node and revision works as expected. But for the guest user the page translations are visible based on recent publish/un publish activity on that node (Any of the translations).
Drupal Version : 8.2.3
Modules Enabled : Multi Language, Domain Access
Comment #5
agentrickardThanks. You can update issue status when providing requested information.
It sounds like the langcode option is not getting set correctly in the {node_access} table.
Can you report what records you have in {node_access} for the affected content?
Comment #6
agentrickardI was able to replicate this from the instructions. It looks like a bug in handle permissions for unpublished content.
Here's what I have in node_access after the following steps:
* Create two nodes assigned to different domains
* Enable Dutch as a second language
* Translate node 1 into Dutch and save as unpublished.
The English version of the node should have the domain_id realm, not domain_unpublished.
I also think the "fallback" value is incorrect.
Comment #7
agentrickardThere is a (to me) nasty omission in the definition of hook_node_access_records():
Which means that we must supply the different access records for each node translation on save. That's pretty nasty. it is also possible, in theory, to have different domains per translation, but that isn't supported by the logic I think makes sense.
Comment #8
agentrickardOK, this is a tricky issue.
Technically, the node isn't unpublished, but its node access grants are. That means we have to save translation-specific records.
That opens up some potential issues:
* Access grants are now different per language -- which could cause confusion.
* I don't think the 'fallback' property is being set correctly in the {node_access} table. (In my test, it always sets to the language of the node being saved, not the site's default language translations.)
The fallback problem is compounded by 'domain_site' which is either on or off, so it doesn't get saved for all translations. I've worked around that by setting the value to 1 if it's disabled for a translation.
We have a few options here, the easiest of which is to not allow the field to be translated.
I'd appreciate some thoughtful review. We're also going to need tests.
Comment #9
agentrickardSlightly better patch. There is no need to store domain_site as a negative value unless translations are enabled and present.
Comment #10
gurumurthy@drupal CreditAttribution: gurumurthy@drupal commentedHi,
I have applied the patch but we got some issue while adding the content. I have shared the error blow.
Uncaught PHP Exception Symfony\Component\DependencyIn jection\Exception\ServiceNotFoundException: "You have requested a non-existent s ervice "domain.element_manager"." at /var/www/html/core/lib/Drupal/Component/Dep endencyInjection/Container.php line 157
Please let me know if you have any idea.
Comment #11
agentrickardSorry, I was on vacation.
What version of the code are you running? That service was added in alpha6 -- https://www.drupal.org/project/domain/releases/8.x-1.0-alpha6 -- and requires rebuilding the service container.
This patch is against the latest code (alpha7/dev).
Comment #12
gurumurthy@drupal CreditAttribution: gurumurthy@drupal commentedThanks for the update. It is working fine.
Comment #13
agentrickardThanks. This has been committed and pushed to drupal.org.
Comment #15
Wouter Waeytens CreditAttribution: Wouter Waeytens commentedCame across this issue when a source language when you unpublish the source language of a node. The node was not visible anymore in views. https://www.drupal.org/project/drupal/issues/3061782 fixed my issue.