Cache clear required after changing taxonomy term to reflect the correct weight

Created on 10 March 2020, over 4 years ago
Updated 6 August 2023, over 1 year ago

Problem description:

TL;DR:

When editing and saving an existing taxonomy term (e.g. simply the name), the corresponding menu item weight is wrongly set to the taxonomy term weight until cache is cleared.

Example:

Before save:
- taxonomy term has a weight of "0"
- its menu item has a weight of -49 in them menu (because menu handles different weights and has additional menu entires)
=> Everything is ordered correctly

After save but BEFORE manual cache clear, e.g. via drush cr
- taxonomy term has a weight of "0"
- its menu item has a weight of 0 in them menu (because menu handles different weights and has additional menu entires)
=> Menu item appears at wrong position

After save AND cache clear:
Everything is allright again:
- taxonomy term has a weight of "0"
- its menu item has a weight of -49 in them menu (because menu handles different weights and has additional menu entires)
=> Everything is ordered correctly again!

So in this intermediate state something is wrong and I guess there may be several issues out there describing this problem...

Any ideas how that happens, are perhaps required cache tags not cleared by taxonomy_menu on taxonomy term save?

๐Ÿ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.71.5 2024