Menu

MediaHub 1.22.31 (Beta): Import security, repeater crops, and Replace file polish

Public beta after 1.22.2. Import by URL security, repeater crop scoping, permissions, and a broad fix sweep, plus Replace file UI improvements (confirmation, mhv cache-busting, job recovery). Staging recommended; 1.22.2 stays production.

Peter Knight

Peter Knight

26 November 2026

Posted in Products · Tagged ProcessWire, MediaHub

MediaHub 1.22.31 is a public beta. The headline work is a security fix for Import by URL, repeater crop scoping, permission tidy-up, and a wide fix sweep from a code review pass. It is not a second launch of Replace file. That feature landed in 1.22.30 (Beta); 1.22.31 is mostly Replace file UI and technical follow-up: a confirmation screen you can read at a glance, optional mhv cache-busting on the front end, and recovery when a staged swap is interrupted. Treat this build as staging and licence-holder testing until it graduates. 1.22.2 remains the recommended production release. Full notes: changelog.


Before you upgrade

Read these four items even if you only skim the rest. Each one can change what editors or developers see after you install the beta.

1. Import by URL: security fix

Setup › Media Hub › Import › By URL now accepts web addresses (http:// / https://) and YouTube or Vimeo links only. Paths to files on your server are refused, with a message pointing to Scan & Import (images already on the site) or Upload (everything else). Redirects are checked so a public URL cannot bounce the import to a private address.

If your editors use Import by URL on a production site, plan an upgrade path promptly. The beta label does not make this less relevant on live installs.

2. Permission renamed: media-hub-admin → mediahub-admin

All MediaHub permissions now start with mediahub-. The rename happens automatically on upgrade; roles that had the old permission keep access. Nothing to reassign in the admin.

Custom code only: any template, hook, or module that calls hasPermission('media-hub-admin') must use mediahub-admin instead. Until you change it, that check fails for everyone except superusers.

3. Optional mediahub-import-screen permission

New, and optional. Until you create it under Access › Permissions › Add New, behaviour is unchanged. Once it exists, only superusers and roles you grant it to can open Setup › Media Hub › Import (Scan & Import and Import by URL). Import page images in page fields is not gated.

4. Crops inside Repeater and Repeater Matrix items

Crops saved from a crop badge inside a repeater item now belong to that item, so the front end and the badge stay in sync after reload. Crops saved from a badge before 1.22.31 are not moved automatically. You can re-crop by hand or follow Repair crops saved in repeaters. The repair script is not in the download zip. Contact support if you need the CLI helper.


Replace file polish: confirmation UI

After you choose a replacement, the dialog shows the current and new file side by side, labelled Old and New, with format, dimensions, file size, and modified date under each preview. When the aspect ratio changes, the New preview draws the previous shape as a dashed outline at the new width, and the Changes and Rich text groups warn you and link to Check usage so you can open pages where saved layouts might look cropped or stretched.

Changes, Rich text, and Filename group what happens next. Rich-text fields keep their saved width and height; the dialog lists tracked uses and links to Check usage when you need to review pages manually. Usage counts refresh when you pick the file, so they stay accurate if someone embedded the asset while you had the page open.

MediaHub Replace file confirmation with Old and New previews and grouped change summary
Replace file confirmation after 1.22.31: side-by-side previews and what happens next.

The underlying swap still works the way 1.22.30 described: staged jobs, crop rebuild, and logging unchanged. This release is about what you see and what happens when something goes wrong. Details: Replace file.


Replace file: optional cache-busting (mhv)

You replace a hero image in the library but keep the same filename so fields, crops, and bookmarked links stay valid. In the admin the new photo is there. In a private browser window the site still shows the old one. That is almost always caching: the URL did not change, so the browser, the host, or a CDN keeps serving the previous file.

Cache-bust replaced files is optional (under Modules › MediaHub › Replacing files, off by default). When you turn it on, MediaHub adds a small version tag to that asset’s addresses in the HTML your visitors receive, for example photo.jpg?mhv=20261120150645 (the tag is the UTC date and time of the replacement). Guests and logged-out users get a fresh fetch. Nothing is written into page fields, and any mhv pasted into a field is stripped on save so it does not end up stored in the database. It does not replace your own ?v= query strings and it leaves signed CDN or S3 URLs alone.

Logged-in front-end editors are the deliberate exception. If you are signed in and can edit the page on the front end (PageFrontEdit), MediaHub does not add mhv to the HTML you see. A front-end save would otherwise write those versioned URLs into your body copy and lock them into the database. After you replace a file, check what visitors actually get in a private window, another browser, or while logged out. In the admin, rich text and page fields always show plain URLs.

You do not have to use it. Turn it on when you replace files in place and the site looks updated in the library but stale on the front end. Leave it off if you already append your own cache keys in templates or you purge cache by hand after every swap.

When ProCache is installed, MediaHub can search cached HTML for those addresses and clear matching pages, including template listings the Usage table never knew about. While logged in, read the X-MediaHub-Cachebust response header (superusers also get a short HTML comment before </body>) to confirm how many versioned URLs visitors receive on that page. See Configuration → Replacing files.


Everything else in brief

1.22.31 also fixes interrupted Replace file jobs (Run again), import matching and failed-import cleanup, page-field and crop scoping, the Unused utility filter, TinyMCE MediaHub buttons in secondary editors, bundled admin translations on newer screens, and more. The changelog lists 70+ items from a full code review pass, grouped by security and permissions, Replace file, crops, page fields, import, the library, rich text, and admin, with every line spelled out in full.


Upgrading and download

Install over 1.22.30 (Beta) or any 1.22.x build through the Modules screen. No database migration. Refresh Process MediaHub afterwards. Prefer staging while you test the beta, especially Import by URL and repeater crops if those apply to your site.

Download: MediaHub 1.22.31 (Beta) for signed-in licence holders. Roll back to 1.22.2 if you need a known-stable production build.


More about MediaHub