- Issue created by @SamLerner
When saving any entity other than a node, like a media entity, a warning is reported:
Could not find /node/123 in path_alias table.
This happens in the BetaAliasStorage::updateTable
method, because code in _cbl_save_beta_alias()
in the .module code assumes it's a node being saved.
$nid = $form_object->getEntity()->id();
if ($alias) {
\Drupal::service('betasite.beta_alias_storage')->saveAlias($nid, $alias);
}
else {
\Drupal::service('betasite.beta_alias_storage')->deleteAlias($nid);
}
Both the saveAlias()
and deleteAlias
methods add a "/node/" before the parameter, so it always looks for node paths, which it won't find with non-node entities.
The code needs reworked in the saveAlias/deleteAlias
so that it knows what type of entity it is, and which path to check for.
Active
1.0
Code