Closed (fixed)
Project:
Entity Mesh
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Apr 2025 at 11:11 UTC
Updated:
25 Apr 2025 at 12:34 UTC
Jump to comment: Most recent
Currently, we check the access on the target URL but not in the source translations.
When it loads a node and its translations, the entity mesh do not review if the source translation is accessible or not.
Create a node with multiple translations.
The main one will be published and the other will remain unpublished.
Index them on entity mesh.
The translation will appear on entity mesh.
Exclude unpublished translations from entity mesh.
\Drupal\entity_mesh\Entity::processTranslatableEntity
protected function processTranslatableEntity(TranslatableInterface $entity) {
$translations = $entity->getTranslationLanguages();
$langcodes = array_keys($translations);
foreach ($langcodes as $langcode) {
// Check if the translation is accessible.
$translation = $entity->getTranslation($langcode);
if ($translation instanceof EntityInterface) {
$this->processEntityItem($translation);
}
}
}
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
Comment #2
eduardo morales albertiComment #4
gedur commentedI suggest to check only the access, there could be websites where unpublished content is accessible for anonymous. Additionally, in the near future we can support other roles scan (e.g., for intranets with authenticated users), that way the code will be compatible.
Comment #5
eduardo morales albertiReady to review
Comment #6
lpeidro commentedI have review the code and it looks great. I added a suggestion in the code.
Thanks your, Edu.
Comment #7
eduardo morales albertiMerged!
Fixed!