Skip to content

Fix link-box contrast, legacy migration steps and tests that only pass together - #18

Open
bonelifer wants to merge 2 commits into
mainfrom
fix/remaining-bugs
Open

bonelifer wants to merge 2 commits into
mainfrom
fix/remaining-bugs

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

More fixes found while checking an outside validation report against the Knowledge Base: the article link boxes' contrast, two steps in the oldest migrations, and test files that only passed when the whole suite ran.

Article link boxes

The copy-link boxes on an article page used #2e8b57 on white, 4.25:1; small text needs 4.5:1. They now use #237047, about 6:1. tests/browser/kb_form_access.js checks it (10 checks now); the check fails on the old colour.

Legacy migration steps

  • version_1_0_0's set_default_config() listed every allowed file extension twice: its inner loop ran once per column of each row. It also read undefined variables when no extension group was allowed. It now lists each extension once. Boards that already ran it keep the repeats until the ACP extensions page is next saved; that changes nothing in use, since the list only decides which file types uploads accept.
  • For boards with an older Knowledge Base's settings table, the same step dropped kb_config.is_dynamic with a plain ALTER TABLE ... DROP COLUMN. It now uses phpBB's database tools, which also remove the column's default first on MSSQL, where a plain DROP COLUMN fails, and it checks that the column exists.
  • version_2_0_1 converts the old serialized kb_extensions setting with unserialize(..., ['allowed_classes' => false]), so no object is ever created from it. The .github/epv-allowed.txt reason says so.

Smaller

The stylesheet route answers a missing file with an empty 404 instead of the English words "Not found".

Tests

kb_alternative_style_test.php, kb_article_text_test.php, kb_board_search_test.php and kb_recent_changes_test.php used phpBB's utf_tools.php or the extension's functions_kb.php without loading them. They passed only when another test had loaded those first. Run on their own, they failed, or stopped silently with a passing exit code, since utf_tools.php exits when IN_PHPBB isn't defined. Each now loads what it uses.

New tests/kb_legacy_migration_test.php runs the old-settings step on SQLite, MySQL and PostgreSQL (the column is gone, each extension is listed once) and checks that an object stored in the old setting is never created.

Claude ran:

  • The PHPUnit suite on phpBB 3.3.x and master with the MySQL and PostgreSQL fixtures: 586 tests, none skipped. Every test file also passes when run on its own.
  • tests/browser/kb_form_access.js (10 of 10) and tests/browser/kb_page_sweep.js (27 of 27) on fresh seed-forum SQLite boards for phpBB 3.3.19 and 4.0.0-a3-dev.
  • EPV on both branches and phpcs with the 3.3 and 4.0 rulesets: clean.

Investigated and written by Claude on behalf of William Jacoby (bonelifer).

🤖 Generated with Claude Code

bonelifer and others added 2 commits November 12, 2026 19:37
…s together

- The article link boxes used #2e8b57 on white (4.25:1); they now use
  #237047 (6:1).
- The stylesheet route's 404 carries no hard-coded English text.
- version_1_0_0 listed every allowed file extension twice, once per
  column of the row, and read undefined variables when no extension
  group was allowed; it now lists each once. It drops the old
  kb_config.is_dynamic column through phpBB's database tools, which also
  handle MSSQL, instead of a plain DROP COLUMN.
- version_2_0_1 unserializes the old kb_extensions setting without
  creating objects.
- Four test files depended on other tests loading phpBB's utf_tools.php
  or functions_kb.php and failed, or exited silently, when run alone.
- New tests: the legacy steps on SQLite, MySQL and PostgreSQL, an object
  in the old setting, the empty 404 body, and the link-box contrast in
  kb_form_access.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant