Do not load all nodes/comments with loadMultiple()

Created on 8 October 2025, 3 days ago

Problem/Motivation

Notify loads all nodes/comments in database using

  • $this->entityTypeManager->getStorage('node')->loadMultiple()
  • $this->entityTypeManager->getStorage('comment')->loadMultiple();

in \Drupal\notify\Notify::send().

When the site has many nodes (like 50,000+ nodes), PHP uses up memory / execution time with those lines.

Proposed resolution

Do not use loadMultiple(), use entityQuery or SelectQuery instead and gather entity-id / created / changed used later.

Attached is the patch.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇯🇵Japan Hidehisa

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.

No activities found.

Production build 0.71.5 2024