Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Events After saving / updating nodes of type happen before record is written to database

オープン
#175 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php
領域
backend

調査の方向性

Start by reading node_save(), hook_node_insert(), and hook_node_update(), then compare their transaction timing with the Rules events described in the issue. Trace the node save events and review the linked Drupal issue and current documentation. Done means the event semantics and user-facing labels or behavior are clearly aligned, with coverage for the resulting expectation.

索引モデルが issue の本文から書いたものです。

説明

The UI for rules events is misleading.

image

There are several possible events that say "after" but the actions happen before. I confirmed this using Rules Throttle which I ported so I could check in a view whether the change had happened.

It is very misleading as there is also an event that says "before saving content". If all the "after" events actually take place before the save, what does the "before" event do?

I've come across this on nodes, but I think this could apply across the board on other entities. I couldn't find anything on our issue queue but checked on Drupal and found this:
https://www.drupal.org/project/rules/issues/2877239

I then looked up our docs which both say:

Note that when this hook is invoked, the changes have not yet been written to the database, because a database transaction is still in progress. The transaction is not finalized until the save operation is entirely completed and node_save() goes out of scope. You should not rely on data in the database at this time as it is not updated yet. You should also note that any write/update database queries executed from this hook are also not committed immediately. Check node_save() and db_transaction() for more info.

https://docs.backdropcms.org/api/backdrop/core%21modules%21node%21node.api.php/function/hook_node_insert/1
https://docs.backdropcms.org/api/backdrop/core%21modules%21node%21node.api.php/function/hook_node_update/1

I have two questions:

  1. Is there any way in rules to do actions after the save event?
  2. Should we be looking to improve the UX here so that user expectations are managed?
主要言語
PHP
スター
5
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

backdrop-contrib/rules のほかの issue

backdrop-contrib/rules の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。