Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Avoid undefined enabled-key warnings in limitation checks

Cerrado
#1,909 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@superdav42 ya está trabajando en esto.

Desde el 7/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
218
Forks
87
Merge medio
1 d 7 h
PR fusionados (30 d)
85

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Ultimate-Multisite/ultimate-multisite

Todos los issues de Ultimate-Multisite/ultimate-multisite

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.