Skip to content

Act on the real article name after a confirm box - #37

Merged
bonelifer merged 1 commit into
mainfrom
fix/confirm-names-with-spaces
Oct 12, 2026
Merged

bonelifer merged 1 commit into
mainfrom
fix/confirm-names-with-spaces

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

What this does

Fixes three actions that silently failed for any article whose name contains a space (most of them):

  • Delete an article (moderator controls, version history) reported "The article has been deleted successfully" and deleted nothing.
  • Set an article inactive reported "The article has been set to inactive" and changed nothing.
  • Delete an uploaded file (added in Let editors upload files to an article #35) answered "The file does not exist." instead of deleting it.

The cause: confirm_box() posts back to an address whose path is encoded a second time, so the route gave Some%20Article instead of Some Article and every query on the name matched nothing. The handlers now take the name from the hidden field the confirm box already carries (functions::confirmed_article()), falling back to the route's name on the first request, before the box. Names without a space were never affected, which is why earlier tests, which used underscores, did not see it.

The delete handler gains the request object as a constructor argument for this (its service definition is updated).

Testing

Claude reproduced all three failures on a phpBB 4.0 (master) board seeded by the new wiki fixtures: the article delete showed success with the row still in the table, and the file delete answered "The file does not exist." After the change, on the same board and on throwaway phpBB 3.3.19 boards with MySQL 8.0 and with PostgreSQL 16, a browser run confirmed that an uploader can delete their own file from "Markup Guide", a moderator can set "Bulk Article 06" inactive, and a moderator can delete "Markup Guide", whose file rows and files go with it (5 checks per board, all passing). Four new unit tests cover the helper: the posted name wins over the route's, the route's name is used before the box, HTML escaping is undone, and Unicode survives. All 66 wiki unit tests pass.


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

confirm_box() posts back to an address whose path is encoded twice, so an
article called "Some Article" arrived as "Some%20Article" and matched
nothing. Deleting an article and switching one off reported success but
changed nothing, and deleting an uploaded file said the file did not exist,
for every article name containing a space. The handlers now use the name
the box carried in a hidden field.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit 9376e25 into main Oct 12, 2026
58 checks passed
@bonelifer
bonelifer deleted the fix/confirm-names-with-spaces branch October 12, 2026 18:23
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