Dev: Make getInsertID() more consistent with save()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
フォーラムのスレッドを読み、その後 System Model の save()、insert()、update()、getInsertID() の動作を比較します。何かを変更する前に、対象 ID の意図されたセマンティクスを確認してください。save() が insert パスと update パスの両方で期待される ID を一貫して公開し、各パスのカバレッジがある状態を完了とします。
索引モデルが issue の本文から書いたものです。
説明
PHP Version
8.2, 8.3
CodeIgniter4 Version
latest
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
macOS, Linux
Which server did you use?
fpm-fcgi
Database
MaraiaDB
What happened?
Not exactly a bug, but not really a FR either. See this forum thread: https://forum.codeigniter.com/showthread.php?tid=91800&pid=421782#pid421782
Essentially I'm offering to PR a change to \System\Model::update() that would set an instance's $insertID property the same way \System\Model::insert() does so that the behaviour of save() is more consistent.
Currently \System\Model::getInsertID() only returns a value if a save() does an insert. The logic needed to handle that works against the elegance provided by save().
Steps to Reproduce
Use \System\Model::save()
Expected Output
Best case, \System\Model::getInsertID() will return the "affected ID" after \System\Model::save() regardless of which action occurred.
Anything else?
I'm stoked contribute to core, but I didn't want to spend the time on a PR if there is no desire to change this behaviour. Please advise.
I can write the update to the docs too if I'm pointed in the right direction to do so.
- 主要言語
- PHP
- スター
- 6k
- フォーク
- 2k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 59
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codeigniter4/CodeIgniter4 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codeigniter4/CodeIgniter4#10616 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
codeigniter4/CodeIgniter4#10618 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
codeigniter4/CodeIgniter4#10617 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
codeigniter4/CodeIgniter4#10615 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
codeigniter4/CodeIgniter4#10589 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
codeigniter4/CodeIgniter4 の issue をすべて見る
似ている issue
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Refund Analytics Tool — “Check” Button Fails to Render in WooCommerce 11.2.1対応中かも @MinhazI が今日担当しました。 オープンBug Reports/Analytics type: community contribution
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
woocommerce/woocommerce#69689 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
メンテナーはふだん 2 日以内に返信