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

Avoid undefined enabled-key warnings in limitation checks

クローズ
#1,909 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@superdav42 がすでに取り組んでいます。

2026年10月7日 から。

評価

この issue はまだ評価されていません。

説明

bug origin:interactive status:in-review

Bug and reproduction

On PHP 8.4, Limitations::has_limitations() emits Undefined array key "enabled" when a module contains configuration but no explicit enabled flag. A synthetic example is new Limitations(['users' => ['limit' => 5]]).

is_module_enabled() already treats an absent enabled flag as disabled. has_limitations() should do the same without emitting warnings, while preserving truthy/falsey legacy flags and enabled modules later in the list.

Implementation files and pattern

  • inc/objects/class-limitations.php: use a presence-safe truthiness check in has_limitations(); preserve public signatures and stored data.
  • tests/WP_Ultimo/Objects/Limitations_Test.php: extend the existing hasLimitationsDataProvider for missing, empty, null, disabled, zero-string, truthy legacy and mixed module data.

Verification

  • Source and test syntax checks pass.
  • Focused PHPCS and PHPStan checks pass.
  • A database-free runtime check covers eight module configurations without warnings.
  • The existing PHPUnit provider covers the original and new cases; no new test infrastructure or production changes are introduced by the fix.

aidevops.sh v3.34.13 plugin for OpenCode v1.18.31 with gpt-6.1-sol spent 22h 2m and 1,270,263 tokens on this with the user in an interactive session.

主要言語
PHP
スター
218
フォーク
87
平均マージ
1日 7時間
マージ済み PR(30日)
85

環境構築

はじめの一歩

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

Ultimate-Multisite/ultimate-multisite のほかの issue

Ultimate-Multisite/ultimate-multisite の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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