# CPalius CMF 1.1.3

**Released:** 2026-09-16 · **Channel:** stable · **Critical:** no

A fix for the patch installer itself, found by applying 1.1.2 to a live site.
Anyone who is on 1.1.2 should take this before the next patch.

Turkish: [1.1.3-tr.md](1.1.3-tr.md)

## What broke

Applying 1.1.2 took the site down with:

```
ArgumentCountError: Too few arguments to function
Modules\Forum\Service\ForumReputationService::__construct(),
6 passed in .../cache/prod/ContainerXXXX/getForumReputationServiceService.php
and exactly 7 expected
```

New class file on disk, old compiled factory in the cache. The patch had already
been written, so retrying could not help either.

## Why

The kernel cache purge is deliberately deferred to shutdown — renaming the
compiled container out from under a request that is still running is its own
kind of fatal. The consequence is a window: from the moment `apply()` returns
until the response is flushed, every line of code that still runs is **new class
files going through the old container**.

The patch screen then did the two worst possible things in that window: it ran
the whole update planner, and it rendered the full updates page. 1.1.2 changed a
service constructor from six arguments to seven, and that was that. Every
previous patch had got away with it only because none of them had changed a
constructor.

## Fixes

- **Success is now a redirect and nothing else.** A `RedirectResponse` needs the
  router and nothing more, and the router was loaded long before the patch was
  written. The purge runs at shutdown as before, and the GET that follows is
  served by a container rebuilt from the new code. The patch log survives the
  redirect and is shown on the page you land on.

- **A failed purge is no longer silent.** Every filesystem call in the purge is
  error-suppressed, so "no exception" never meant "the directory is gone" — and
  the operator had already been shown "caches cleared". The purge now verifies
  itself by counting leftover compiled factory files, and when it has not worked
  it leaves `cp-core/var/update/cache-purge-failed.json`. The updates screen
  reads that and says so in red, with what to do about it.

  This matters most on shared hosting, where the cache directory is often owned
  by a different user than the one PHP runs as.

- The failure path is unchanged and still renders the full screen: the installer
  restores the previous files before throwing, so the tree matches the container
  again and there is nothing unsafe about it.

## Upgrade notes

Nothing to do beyond applying the patch.

**If you are stuck on 1.1.2 right now** — the site 500s with an
`ArgumentCountError` — the patch cannot be applied through a panel that will not
load. Delete everything inside `cp-core/var/cache/prod/` over FTP (keep the
folder itself), then open the site. The first request rebuilds the container and
takes a few seconds. If your host has OPcache with `opcache.validate_timestamps=0`,
restart PHP from the hosting panel as well, otherwise the deleted files keep
being served from memory.
