0

I uploaded multiple PDF files to a wordpress site i take care of. I used the admin-dashboard to upload those. So here is the problem:

Anything worked fine before hand, I did not change any plugins nor did I update anything. Files were shown as usual. After uploading these multiple PDFs however, the media library no shows, it's empty (see pic).

Text in middle area says: No Mediadata found

If I change the view to list view, it shows the following:

Names of the files are "(no title)" and in the back it says "(not linked)"

And now for the weird part: The data is still there. Not only on the FTP-server, even in the media library. If I filter for Pictures/Audio/Video/etc., all those show up correctly - except for documents, that does not work. But if I filter by month and go through the month - everything shows up, even the old documents!

Only the newly uploaded documents don't show up or cause this phenomenon in the pictures above.

Plus, if I try to upload data now, it fails, so thats a big problem.

So, what is going on? I guess, there's a linking error in the database - but how do I resolve this? I do have access to the remote FTP-server, but how can I access the actual database? I did not find any files, that match the database name stated in the wp-config.php.

Is this fixable? Because I tried my very best and I'm stuck now.

EDIT: After days of asking I found out, that we have cPanel for this. So I got access to the wordpress database and simply deleted the rows with the problematic items. The media library does show every item again, in Grid and Listview. It just still doesn't let me upload anything. The error shown says "an error happened during the upload." - very helpful. I noticed though, that the files get uploaded to the server, they just don't show up in the media library. When using the file uploader, wordpress' progress bar gets stuck on "Processing ...".

EDIT 2: It's not just images and files. Everything new gets saved with the ID "0" in the database, so I guess there's an error when grabbing the current ID? But how to fix it?

  • Check your server side [PHP error logs](https://stackoverflow.com/questions/5127838/where-does-php-store-the-error-log-php5-apache-fastcgi-cpanel). – Martin Aug 28 '20 at 14:22
  • I found an error log on the server - but we don't use cPanel or anything, so it's a little bit janky to fiddle with or find files :D the only errors, which might relate to the issue, are the following: `[28-Aug-2020 12:41:50 UTC] PHP Notice: Trying to get property 'post_parent' of non-object in /wp-admin/includes/class-wp-media-list-table.php on line 504` The same for the properties "'post_author", "post_status", "post_date" and "ID" – heimdall1706 Aug 29 '20 at 21:36
  • Please edit your opst to add this information and also show us the code that relates to these line numbers, thanks. – Martin Aug 30 '20 at 10:02
  • @Martin, I got cPanel-access, but I still have one last problem. The upload, or the wordpress internal linking of files to the media library, does not work. – heimdall1706 Sep 02 '20 at 16:35
  • You will need to view your error logs to see what is actually going on. You will need to ask your hosting provider how to access your database directly. CPanel usually has a PHPMyAdmin installation running for the cPanel user. – Martin Sep 02 '20 at 19:07

2 Answers2

1

I've got it now, finally. Somehow all my tables in the database lost their primary keys and their auto-increment feature. So obviously wordpress added new entries with ID = 0, but wordpress starts counting at 1, this is, what broke my media library.

I just went ham and replaced every table with a new one and copied the old values. This solved the problem. The wordpress documentation helped a lot!

https://codex.wordpress.org/Database_Description

-1

From the dashboard, i can see the pdf file is loaded in the media library however in the media library accessed from the edit block (trying to load a pdf) the pdf files are not seen. This is now the default state of both of my websites... not linked Trev

  • I found out about my problem in the same way. Maybe check, if the IDs of the items in the database are correct/above 0 and if they still are set as primary key? Especially in the "wp_posts" table, where all of the content is saved. – heimdall1706 Oct 27 '20 at 09:56