[wp-trac] [WordPress Trac] #56260: In case of missing primary key on wp_posts, Media uploader gives false feedback indicating folder permissions are missing, where in fact database structure is malformed.

WordPress Trac noreply at wordpress.org
Wed Jul 20 15:59:51 UTC 2022


#56260: In case of missing primary key on wp_posts, Media uploader gives false
feedback indicating folder permissions are missing, where in fact database
structure is malformed.
--------------------------+-----------------------------
 Reporter:  harryfear     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi community,

 Files won't upload to the media library and a misleading feedback is
 presented to the user (indicating there is an uploads/months/day
 permissions issue), where in fact the file is written successfully to disk
 – but WP can't write to the wp_posts database.

 I stumbled upon this as part of #56259 whereby wp_posts missing primary
 key + A.I. attributes are not picked up by WordPress (even in its
 repair.php functionality).

 The same happens with failed media uploads. The UI reports the failure to
 write to a folder. Whereas the AJAX response is an unhandled full-HTML
 page. The UI error is a mismatch from the server response.

 Steps to reproduce:—

 • Break AutoIncrement and Primary Key for wp_posts (can happen through
 user misfortune or third-party plugin or failed migration).

 • Upload media

 • Failure notice reports disk permissions failure, whereas the issue is in
 fact the database structure issue.

 Forgive haste on this write-up.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56260>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list