Database::startLog() cause a notice in Shortcut::sort()

Created on 11 September 2015, almost 9 years ago
Updated 26 January 2023, over 1 year ago

Problem/Motivation

Database::startLog() calls Log::findCaller() that calls debug_backtrace() that broke uasort() with

Warning: uasort(): Array was modified by the user comparison function in Drupal\shortcut\Entity\ShortcutSet->getShortcuts() (line 125 of core/modules/shortcut/src/Entity/ShortcutSet.php).

because of this bug: https://bugs.php.net/bug.php?id=50688

Proposed resolution

  1. put a @ before uasort in ShortcutSet::getShortcuts()
  2. use debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) instead of debug_backtrace() (but then we cannot collect args)

Remaining tasks

Decide which solution is better.

User interface changes

None

API changes

None

Data model changes

With solution 2 we don't collect function args.

🐛 Bug report
Status

Closed: outdated

Version

10.1

Component
Shortcut 

Last updated about 1 month ago

Created by

🇮🇹Italy lussoluca Italy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024