#58995 closed defect (bug) (fixed)
Remove individual files from `$_old_files` array when its parent directory is already included
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.5 | Priority: | normal |
| Severity: | normal | Version: | 6.3 |
| Component: | Upgrade/Install | Keywords: | good-first-bug has-patch |
| Focuses: | Cc: |
Description
Chatting with @SergeyBiryukov, it seems that $wp_filesystem->delete( $old_file, true ) is called on entries in the array and the second parameter, $recursive, is set to true. So, individual files aren't necessary when the parent directory is included.
Some precedent exists higher up for older version where individual files were excluded, such as wp-includes/js/tinymce/plugins/wpembed.
Props to @SergeyBiryukov for the discussion.
Attachments (1)
Change History (18)
This ticket was mentioned in PR #4982 on WordPress/wordpress-develop by shohel.
3 years ago
#2
- Keywords has-patch added; needs-patch removed
The implemented update ensures that when processing the $_old_files array, any individual files referenced within the array are excluded from deletion if their corresponding parent directories are already included.
Trac ticket: https://core.trac.wordpress.org/ticket/58995
#3
@
3 years ago
@davidbaumwald @abhi3315
I've eliminated all the individual files that are already encompassed by their parent directory within the $_old_files array.
@abhi3315, my apologies for addressing this matter, as it appears to be consuming more time than anticipated.
@
3 years ago
Attaching the differential file separately for visual reference, allowing anyone to easily observe the highlighted differences.
This ticket was mentioned in Slack in #core-upgrade-install by pbiron. View the logs.
2 years ago
This ticket was mentioned in Slack in #core-upgrade-install by costdev. View the logs.
2 years ago
#6
@
2 years ago
@davidbaumwald isn't the $_old_files array generated by tooling as part of the release process? If that's true, shouldn't that tooling simply be updated to not include a file in the array if a dir in it's path has already been included in the array?
@mhshohel commented on PR #4982:
2 years ago
#7
@pbiron
Hey Paul, thank you for noticing it, I've removed these two files as their parent wp-includes/js/codepress directory already exists
#8
@
2 years ago
@davidbaumwald the PR LGTM, but it wouldn't hurt to have another set of eyes on it.
#10
@
2 years ago
@davidbaumwald I'm wondering if we'll be able to include this fix in 6.4 RC1, which is just ~2 weeks away. It seems that we need some testing instructions and then some testers to check if the patch works. What do you think?
This ticket was mentioned in Slack in #core by nicolefurlan. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
2 years ago
#13
@
2 years ago
- Milestone changed from 6.4 to 6.5
Moving this to 6.5 per discussion in today's bug scrub.
#14
@
2 years ago
@davidbaumwald I checked the PR, and it looks like everything is accurate. Can you, please, progress with the review? Thank you!
@davidbaumwald commented on PR #4982:
2 years ago
#17
@shohel Thanks for the PR! Merged into core in https://core.trac.wordpress.org/changeset/57598.
I am taking up this issue.