Make WordPress Core

Opened 17 years ago

Closed 16 years ago

Last modified 7 years ago

#6834 closed defect (bug) (fixed)

More descriptive create directory/copy errors in file.php

Reported by: plankers's profile plankers Owned by: westi's profile westi
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords: needs-patch
Focuses: Cc:

Description

When using the plugin updater it would be helpful if the error messages indicated what directory the operation was acting on, so that if there are permission errors they can be more easily resolved.

The affected code are lines 262 and 268 of wp-admin/includes/file.php, and a patch is attached.

Attachments (1)

file-php-more-verbose-error.patch (885 bytes) - added by plankers 17 years ago.
Patch for more verbose errors for plugin updater

Download all attachments as: .zip

Change History (7)

@plankers
17 years ago

Patch for more verbose errors for plugin updater

#1 @DD32
17 years ago

You cannot use Variables within translate functions( (), _e() )

Instead you need to use things such as:{{{
return new WP_Error('mkdir_failed', sprintf(('Could not create directory: %s', $to . $tmppath));
}}
(Thats just an example).

Another option is to pass the error data along with the WP Error:

return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath ); 

The updater message will show "Could not create directory: $errordata"

I agree that it needs to be a bit more verbose.

#2 @DD32
17 years ago

Just a quick note, I've been changing a few of the functions over to utilise WP_Error, But most of them are in file.php, So right now i'm awaiting to see the outcome of #6465 as the changes have been applied to the same install, and any patch will conflict.

#3 @westi
16 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from 2.7 to 2.8
  • Owner changed from anonymous to westi
  • Status changed from new to assigned
  • Type changed from enhancement to defect

New patch needed.

#4 @DD32
16 years ago

New patch needed.

I believe its been implemented in one of my other patches: http://trac.wordpress.org/browser/trunk/wp-admin/includes/file.php#L546

However, I'm not sure if its shown upstream in the show_message() function yet.

#5 @westi
16 years ago

  • Milestone changed from 2.8 to 2.7
  • Resolution set to fixed
  • Status changed from assigned to closed

Looks like show_message pulls that data out.

Marking as Fixed.

This ticket was mentioned in Slack in #core-editor by chrisvanpatten. View the logs.


7 years ago

Note: See TracTickets for help on using tickets.