Opened 10 years ago
Closed 10 years ago
#36570 closed defect (bug) (fixed)
PHP Warning mkdir(): File exists only when I update the translations
| Reported by: | overclokk | Owned by: | ocean90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6 |
| Component: | Filesystem API | Version: | 4.5 |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
Description
Hi,
I got this error only when I update the translation in update-core.php.
I'm on VVV
WP 4.5
PHP 5.5.9-1ubuntu4.14
The error is displayed in [Query Monitor plugin](https://it.wordpress.org/plugins/query-monitor/) interface with the following errors:
Warning mkdir(): File exists wp-admin/includes/class-wp-filesystem-direct.php:434
Call Stack
mkdir() wp-admin/includes/class-wp-filesystem-direct.php:434 WP_Filesystem_Direct->mkdir() wp-admin/includes/file.php:676 _unzip_file_ziparchive() wp-admin/includes/file.php:593 unzip_file() wp-admin/includes/class-wp-upgrader.php:291 WP_Upgrader->unpack_package() wp-admin/includes/class-wp-upgrader.php:686 WP_Upgrader->run() wp-admin/includes/class-wp-upgrader.php:2115 Language_Pack_Upgrader->bulk_upgrade() wp-admin/update-core.php:721
However the translations seem to be ok and updated.
How can I debug this error and help you to find a solution?
Attachments (1)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The problem doesn't really lie with
WP_Filesystem_Direct::mkdir(), but with what is fed into it.When unzipping a (translation pack) file, in addition to the original temp directory, for instance
wp-content/upgrade/de_DE-kMvYQt/, the same directory with a full stop (pointing to the directory itself) is added.This is due to the fact that
dirname( 'some-file.ext' )gives'.'.Please see the attached patch that fixes this behavior, and thus the
mkdirwarning.