Hi everyone!
To alter the http protocol and instead set the https in the <link rel=βcanonicalβ...>
element. I have made use of the following hook, hook_page_attachments_alter. I'm using Drupal version 10.2.6 and PHP 8.1.27.
function mytheme_page_attachments_alter(array &$attachments)
{
if (!empty($attachments['#attached']['html_head'])) {
foreach ($attachments['#attached']['html_head'] as $key => $link) {
if (isset($link[0]['#attributes']['rel']) && $link[0]['#attributes']['rel'] === 'canonical') {
$attachments['#attached']['html_head'][$key][0]['#attributes']['href'] = str_replace('http:', 'https:', $link[0]['#attributes']['href']);
}
}
}
}
I hope I can be of help.
Thank you,
Hello again,
doing what you say, uninstalling the theme and reinstalling it from /admin/appearance in the 'Installed theme' section, and changing the administration theme momentarily to another installed theme to be able to press the 'uninstall' button that appears.
Then, in the 'Unistalled themes' section click the Install button, and set the Administration theme selector to 'Gin' and save the configuration by clicking the blue button below.
And now it works as expected with respect to the open issue.
Thank you very much for your help.
I hope it will be useful to other members of the community.
Regards.
Hi!
1.- Are those different Gin versions? The only version of Gin I use is 8.x-3.0-rc2. Also the configuration has been exported/imported via drush cim/cex.
2.- Different websites? Yes, in some installations it appears correctly, and in others it does not.
3.- Which Drupal version are you using? 9.5.4
4.- Did you install Gin like described on the project page? I installed it via Release section, composer require 'drupal/gin:^3.0@RC'
5.- Did you try uninstalling Gin and installing it again? No.
6.- Did you check for DB Updates? Yes, it is up to date.
Thank you!
pau.sanz β created an issue.