The function returns array not string.

/**
 * Returns the hash of the per-user rendered toolbar subtrees.
 *
 * @return string
 *   The hash of the admin_menu subtrees.
 */
function _toolbar_get_subtrees_hash() {
  [$subtrees, $cacheability] = toolbar_get_rendered_subtrees();
  $hash = Crypt::hashBase64(serialize($subtrees));
  return [$hash, $cacheability];
}

Comments

Chi created an issue. See original summary.

asishsajeev’s picture

Status: Active » Needs review
StatusFileSize
new463 bytes

Hi,
Here is the patch.

chi’s picture

Status: Needs review » Needs work

The return description also needs to be updated.

ilgnerfagundes’s picture

Status: Needs work » Needs review
StatusFileSize
new703 bytes

Hello
Here is the patch.

chi’s picture

Status: Needs review » Needs work

admin_menu

Let's keep the "toolbar" term. That will also bring the description to the 80 characters limit.

ilgnerfagundes’s picture

Status: Needs work » Needs review
StatusFileSize
new700 bytes

Hello
Here is the patch.

chi’s picture

Status: Needs review » Needs work

I did not notice, that "admin_menu" was in the original code. I guess that code might be copied a long time ago from Admin Menu module. Anyway I think it worth to change it.

the caching capability

That sounds a bit weird to me. The "cacheability" term is commonly used in Drupal core. Let's use it instead.

ilgnerfagundes’s picture

Status: Needs work » Needs review
StatusFileSize
new689 bytes

Here is the patch.

chi’s picture

Status: Needs review » Reviewed & tested by the community

Thank you.

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 0ff3dada280 to 10.0.x and 2a2b6ad5143 to 9.4.x and 6deb8a8ac56 to 9.3.x. Thanks!

  • alexpott committed 0ff3dad on 10.0.x
    Issue #3258642 by ilgnerfagundes, asishsajeev, Chi: Fix documentation...

  • alexpott committed 2a2b6ad on 9.4.x
    Issue #3258642 by ilgnerfagundes, asishsajeev, Chi: Fix documentation...

  • alexpott committed 6deb8a8 on 9.3.x
    Issue #3258642 by ilgnerfagundes, asishsajeev, Chi: Fix documentation...

Status: Fixed » Closed (fixed)

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