Hmm I take that back... it doesn't seem to be prepending the URL with the language code. Maybe we should just use this method instead:
$entity->toUrl('canonical')->toString()
The second arg of getAliasByPath is langocde. I think we could update this line to account for the language of the entity being saved:
$detail_page = $config->get('detail_page')[$i] ? \Drupal::service('path_alias.manager')->getAliasByPath("/$bundle/" . $entity_id) : '';
changes to:
$detail_page = $config->get('detail_page')[$i] ? \Drupal::service('path_alias.manager')->getAliasByPath("/$bundle/" . $entity_id, $entity->language()->id()) : '';
joncjordan β created an issue.
Thanks for looking into it. I've been away from the office but I can help review when I'm back.
joncjordan β created an issue.
joncjordan β created an issue.
Note that the patch will cause fatal errors with the simple_sitemap_engines module, since Drupal\simple_sitemap_engines\Form\FormHelper extends Drupal\simple_sitemap\Form\FormHelper.
Fatal error: Declaration of Drupal\simple_sitemap_engines\Form\FormHelper::formAlterAccess(): bool must be compatible with Drupal\simple_sitemap\Form\FormHelper::formAlterAccess(Drupal\Core\Entity\EntityFormInterface $form_object): bool in /app/web/modules/contrib/simple_sitemap/modules/simple_sitemap_engines/src/Form/FormHelper.php on line 63