Skip to content

Fix PageDeleteComplete hook calling getTitle() on ProperPageIdentity#86

Merged
JeroenDeDauw merged 3 commits into
masterfrom
fix/page-delete-hook-type-error
Apr 13, 2026
Merged

Fix PageDeleteComplete hook calling getTitle() on ProperPageIdentity#86
JeroenDeDauw merged 3 commits into
masterfrom
fix/page-delete-hook-type-error

Conversation

@JeroenDeDauw

@JeroenDeDauw JeroenDeDauw commented Apr 13, 2026

Copy link
Copy Markdown
Member

Fixes #85

The PageDeleteComplete hook passes a ProperPageIdentity (concretely a
PageStoreRecord) as its first parameter, but the code called
$page->getTitle() which does not exist on that interface. This caused
a fatal error when deleting pages. Use Title::newFromPageIdentity()
instead, which correctly creates a Title from any PageIdentity.

The other two hooks (PageSaveComplete and PageMoveComplete) are unaffected —
PageSaveComplete receives a WikiPage which has getTitle(), and
PageMoveComplete already receives Title objects directly.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

JeroenDeDauw and others added 2 commits April 14, 2026 00:11
Fixes #85

The PageDeleteComplete hook passes a ProperPageIdentity (concretely a
PageStoreRecord) as its first parameter, but the code called
$page->getTitle() which does not exist on that interface. This caused
a fatal error when deleting pages. Use Title::newFromPageIdentity()
instead, which correctly creates a Title from any PageIdentity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.29%. Comparing base (eab4541) to head (3d7e457).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #86      +/-   ##
============================================
+ Coverage     92.11%   92.29%   +0.17%     
  Complexity      166      166              
============================================
  Files            17       17              
  Lines           571      571              
============================================
+ Hits            526      527       +1     
+ Misses           45       44       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JeroenDeDauw JeroenDeDauw marked this pull request as ready for review April 13, 2026 22:29
@JeroenDeDauw JeroenDeDauw merged commit 2d32457 into master Apr 13, 2026
8 checks passed
@JeroenDeDauw JeroenDeDauw deleted the fix/page-delete-hook-type-error branch April 13, 2026 22:29
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.

When deleting a page, SubPageList extension throws an exception

2 participants