Skip to content

History of commits

4477 commits

refactor(admin): give the admin panel its Twig layouts and move its sources into the theme

The chrome of the panel becomes @admin/layouts/{default,guest}.twig on top of @theme/layouts/base.twig, so the head, the color scheme and the flatpickr locale live in one place and only the chrome and the build entry differ between the two areas. The menu of the panel becomes @admin/components/sidebar-admin-menu.twig, and @admin gains pages/result.twig and pages/errors/{403,404}.twig for the callers that will name them. The admin theme needed no debug and sidebar-user-menu of its own: what differed were bugs of the public copies (data-parent instead of data-bs-parent, a Bootstrap 4 close button), fixed in the shared components, while the position of the debug line became a parameter. The counters of the sidebar move to AdminRuntime::counters(), published as admin_counters(): four queries that AdminControllerContext ran on every request to the panel are now paid for by the pages that print them. Seven more counter calls that the Plates sidebar computed and never printed are gone. AdminControllerContext keeps feeding the Plates sidebar until the last .phtml of the panel is migrated. themes/admin/src moves to themes/default/src/admin as it is — two independent asset sets, deduplication deliberately postponed; theme.php and vite.config.js point at the new path and the build was checked. The sprite of the default theme gained the tool icon and the ckeditor hi/tk locales, so the admin layouts resolve every asset through the theme chain. The dashboard is the pilot page of the panel on Twig.
simba77 6 авг 2026 22:43 Branch: 10.x af89365

refactor(login, registration, consent, mail): move the last public pages to Twig

16 .phtml templates become 15 pages and 3 components. The login and registration forms now use the components of the theme (alert, field-errors, consent-checkbox), the tabs of the mail became @mail/public/components/nav.twig, and both editors became module components. Every controller of the four modules returns ViewResponse. MessageItemDTO::$text and ConversationItemDTO::$previewText return Twig\Markup. LogoutController stops running HTTP_REFERER through FILTER_SANITIZE_SPECIAL_CHARS — the environment escapes the output — and RegistrationController hands its cookies to ViewResponse instead of building a Response. Fixed on the way: MailMessagePreviewService passed an int into SmiliesRendererInterface::render(bool) and killed the conversation list with a TypeError. The defect sat in the phpstan baseline and never showed, because the demo database carries no mail.
simba77 6 авг 2026 22:18 Branch: 10.x 1709b68

refactor(forum): move the public pages to Twig

32 .phtml templates become 26 pages and 6 components under templates/public. Duplicates collapse on the way: who and voted_users shared one user row and became visitors.twig and poll-voters.twig, new_topics served three controllers and became topic-list.twig, header and footer became components, and the quick reply form of a topic became a macro instead of two copies. Every controller returns ViewResponse; ForumErrorRenderer gained viewResponse() and keeps render(Render, ...) only for ForumAccessMiddleware, which must return a Response. ForumMessage::$post_text, ViewPostDTO::$body, the search results and the post text of the file listing now return Twig\Markup; htmlentities over the poll form values and htmlspecialchars over the topic name are gone. Nullable flags of the topic and the message (closed, deleted, pinned, has_poll, deleted_by, editor_name, edit_count) get accessors that type them: a null attribute of an Eloquent model falls through to the method of the same name and throws. The trap is written down in .agents/twig-migration.md. Dead code removed on the way: reply_message declared a preview it never printed, so the purifier, the media embed and the smilies renderer left both reply controllers. The heading of the add-poll form said 'Add File'.
simba77 6 авг 2026 22:03 Branch: 10.x dbf70de

refactor(downloads): move the public pages to Twig

27 .phtml templates become 24 pages and 3 components under templates/public; delete_file and delete_additional were byte-identical and merged into confirm-delete.twig. Every controller returns ViewResponse; FileCommentsController and both middlewares stay on Plates (the legacy Comments prints its own page, middleware must return a Response). Escaping moves to output: ~20 htmlspecialchars calls dropped, including the ones that wrote escaped data to the database (name_link, link_text, format). DownloadFile::$about_html and the comment texts of the review page now return Twig\Markup, the 'Prohibited file type!<br>...' message too. Dead FilePresenter::$filtered_name removed and preview_text no longer passes htmlentities. Template headers declare their variables with @var and fully qualified class names; the rule is written down in .agents/twig-migration.md. The phpstan baseline is regenerated: the ignore counts of the module shifted.
simba77 6 авг 2026 21:16 Branch: 10.x 05638af

refactor(library): move the public pages to Twig

All 18 controllers return ViewResponse; 21 .phtml templates become 17 pages and 6 components under templates/public/. Two templates nothing rendered (tagcloud, helpers/printNavPanel) are dropped. Sources of markup now say so in their contract: ArticleTextRenderer::renderPage() returns Markup, and Hashtags::getAllStatTags() splits into getTagLinks(): ?Markup and getTagNames(): array, which were two different things behind one method. Rating stops building HTML and exposes getRate()/getVotesCount()/getUserVote(), so the star and the vote form are components and the Plates Assets extension is no longer a dependency. ViewHelper is gone: it rendered partials through di(Render::class), and the breadcrumbs it built moved into Tree::printNavPanel(). Two defects the output review turned up are fixed along the way: an (int) cast in Rating::getRate() discarded half a point, so the star.*-5.gif images were never used, and an === between an int and a PDO string meant the score a reader had already given was never preselected. LibraryAccessMiddleware stays on Plates: a middleware has to return a Response, and the migrated online/downloads middlewares do the same.
simba77 6 авг 2026 09:07 Branch: 10.x 18566e8

refactor(profile): move the account and settings pages to Twig

The rest of the module: the personal page, the three settings pages, the profile form, the password pages and the e-mail confirmation. No template of the profile is left on Plates. ViewResponse can carry cookies now. Changing one's own password re-issues the persistent login cookie, and that was the one action that needed a Response of its own; the cookies travel with the view instead, and the normalizer sets them. The seven role radios of the profile form are one loop over a list, and the avatar catalogue link points at /help/avatars/ instead of the legacy /help/?act= URL it was redirected from.
simba77 5 авг 2026 23:55 Branch: 10.x f4bad6e

refactor(profile): move the profile pages to Twig

The pages of a user — the profile, the activity, the karma, the bans, the IP history and the image forms. The account and settings pages stay on Plates for now. Escaping moves out of the model and into the templates: - the user agent is stored as the client sent it and escaped where it is printed, so the five Plates templates that print it do that themselves now; - the admin notes lose their SpecialChars cast for the same reason; - "about" and the website are sanitized HTML, so they are Twig\Markup, and null when empty. display_place was still typed string while the place formatter had already started returning Markup, so reading it raised a TypeError — every profile page was broken. It is typed markup now.
simba77 5 авг 2026 23:45 Branch: 10.x 384a05e

refactor(news): move the public pages to Twig

The two search pages were the same file with a different form, so they share one template and the form is a component; the article row of a list is another. text_safe and preview_text_safe hand over Twig\Markup — they are what the purifier and the media embedder produced — and null when there is nothing, so a template can still ask whether there is a lead. The home page prints the lead without a raw filter now. The tags accessor no longer escapes the tags it returns: the value goes to a template, which escapes on output, and the one admin form that prints it into an input does so itself.
simba77 5 авг 2026 23:26 Branch: 10.x 2a42354

refactor(album): move the album pages to Twig

Thirteen templates become twelve plus four components: the photo card and the vote buttons were copied into three pages each, and the grid around them into two. The description of a photo is escaped and given its smiley images by the presenter, so it arrives as Twig\Markup. The comments page still hands back a string — the legacy Comments class prints a whole page of its own — while the error pages it may answer with are views.
simba77 5 авг 2026 23:18 Branch: 10.x 8f19ab3

refactor(collections): move the public pages to Twig

ItemContentFormatter returns Twig\Markup: it purifies the item text on output, which is exactly the contract that lets a template print it as it is. It already answered null for empty content, so nothing had to be invented for the "no text" case. The ten admin templates stay on Plates.
simba77 5 авг 2026 23:00 Branch: 10.x 6e1677c