Accidental implementation of hook_rebuild()

Created on 21 September 2022, over 2 years ago
Updated 12 May 2023, almost 2 years ago

Problem/Motivation

In views_url_alias.module there is a function name function views_url_alias_rebuild(). The function's block comment makes it clear this function is only supposed to be called during installation and other rare circumstances. However, the function's name makes it an implementation of hook_rebuild(), which causes it to be invoked on every cache clear.

This is an issue because the function queries the entire table of the aliases, which can be a large and increasing performance concern.

Steps to reproduce

1. Time how long `drush cr` takes on a site with a non-negligible number of path aliases
2. Install the 2.x branch version of the module on the site
3. TIme how long `drush cr` takes following installation

Proposed resolution

Adding `_path` to the function name and the places it is called resolves the issue.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ao5357

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