It looks like version 2.1 is only compatible with Drupal 8.8.x and above as that is when TrustedCallbackInterface.php was introduced. May need to document somewhere as it killed a deployment on me.

CommentFileSizeAuthor
#7 3121816-07.patch756 byteswengerk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dobe created an issue. See original summary.

adriancid’s picture

Title: Version 2.1 compatibility » Version 8.x-2.1 need Drupal 8.8.0 or greater
Category: Support request » Bug report

  • adriancid committed c57c113 on 8.x-2.x
    Issue #3121816 by dobe, adriancid: Version 8.x-2.1 need Drupal 8.8.0 or...
adriancid’s picture

Status: Active » Fixed
kbrinner’s picture

Me too. I noticed that the contrib module address anticipated such an issue in its AddressDefaultFormatter class:

// @codingStandardsIgnoreStart
// @todo remove this BC layer once support for Drupal 8.7 is sunsetted
if (interface_exists('\Drupal\Core\Security\TrustedCallbackInterface')) {
  interface TrustedCallbackInterface extends \Drupal\Core\Security\TrustedCallbackInterface {}
}
else {
  interface TrustedCallbackInterface {}
}

For now I'm keeping the admin_toolbar at 2.0 while looking in to a more complete fix.

adriancid’s picture

@Kbrinner I release yesterday another version with this patch, so if you're using Drupal 8.8.0 you can install it. I really miss this when I commit the patch in #3117452: Replace admin_toolbar_prerender_toolbar_administration_tray by trusted callback

wengerk’s picture

Issue summary: View changes
FileSize
756 bytes
wengerk’s picture

Issue summary: View changes

For people trying/needing to use 8.2.1 with a Drupal 8.7.x - here is a patch applying the same trick as the address module suggested in #5.

This patch only works if you use the version 8.2.1 of Admin Toolbar.

You can apply the patch using the "extra > patch" section of your composer.json

"patches": {
  "drupal/admin_toolbar": {
    "[3121816] - Version 8.x-2.1 need Drupal 8.8.0 or greater": "https://www.drupal.org/files/issues/2020-03-30/3121816-07.patch"
  }
}

PS: re-add the original issue summary ... was not awake this morning...

s-jack’s picture

After editing the composer.json file directly, how do I execute the composer command to apply the extra section?

esolitos’s picture

@s-jack: A safe way to do it is to run composer update nothing.

s-jack’s picture

Hi, esolitos.
I ran composer update because there were updates for other modules and libraries.
It was successful, thank you.

Is there a composer command that can only apply patches without updating modules or libraries?

xmacinfo’s picture

Is there a composer command that can only apply patches without updating modules or libraries?

Yes, it is:

composer update --lock

s-jack’s picture

Hi, xmacinfo.
Thanks for telling me useful commands.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jndvrk’s picture

Sorry for adding onto a closed issue. Has version 2.1 been updated with the above fix? I just tried installing version 2.1 onto a Drupal 8.7.8 site and all I was seeing is 'skip to main content' and nothing else. Version 2.0 works without issues.

(was updating from 1.x)

lithiumlab’s picture

Found this issue while updating to 2.1 on a Drupal 8.7.10 site.