Skip to content

Theme force update fails with ZipArchive::extractTo() — "No such file or directory" #409

@nordmanndev

Description

@nordmanndev

Description

When triggering a theme update (force update) from the admin panel, the process downloads and unpacks the theme zip file but then fails with a PHP warning because the target extraction path does not exist. The update rolls back but leaves the theme in a broken state.


Error message

Warning: ZipArchive::extractTo(/var/www/vhosts/timetables.online/httpdocs/public/themes//blog-default/index-excerpts.html): Failed to open stream: No such file or directory in /var/www/vhosts/timetables.online/httpdocs/system/extensions/themes.php on line 216


---

Steps to reproduce

  1. Install Vvveb CMS (multisite setup, Document Root: www/)
  2. Navigate to Configuration → Themes in the admin panel
  3. Select the Blog default theme and click Update / Force update
  4. Observe the install log and the PHP warning at the top of the page

Install log (from UI)

Installing "Blog default" Downloading "https://www.vvveb.com/market/themes/blog-default.zip" Backup theme "blog-default" Backup complete - Blog default backup 2026-03-24 08:49:46 Unpacking "/tmp/vvveb_pluginfIlrlmi5vu6p1XYguAY" Error updating "blog-default"!


---

Observed behavior

Download and backup succeed. Unpacking of the temp file starts but ZipArchive::extractTo() fails because the intermediate directory public/themes/blog-default/ does not exist before extraction is attempted.

Final status: "Error updating blog-default!"


Expected behavior

The theme update should ensure the target directory exists before calling extractTo(), or extract to a temp path first and then move the result.


Suggested fix (system/extensions/themes.php ~line 216)

// Before calling $zip->extractTo($targetPath):
if (!is_dir($targetPath)) {
    mkdir($targetPath, 0755, true);
}
</code></pre>
<hr>
<h3>Environment</h3>

  |  
-- | --
Vvveb version | Latest (2026-03-24)
PHP version | 8.x
Server | Apache/Nginx, Linux vhost
Affected file | system/extensions/themes.php


<pre><code>

### Environment

| | |
|---|---|
| Vvveb version | Latest (2026-03-24) |
| Setup | Multisite (2+ sites) |
| Likely area | Site delete controller / DB cascade rules |
</code></pre></body></html><!--EndFragment-->
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions