Search

I do not know how this has happened, but all the images I have uploaded to my site are missing in the admin, even though they are showing up completely fine on the site.

For some reason, now, whenever I try uploading an image, I do the regular process i have been doing for at least a month now, and when i click to save the information, i receive this error:

Unknown Entry  
The entry you are looking for could not be found.

I am receiving a url that looks like this at the end of if: /symphony/publish/project-images/edit/399/created:64:397/

not sure if that is any help or not.

In the attached file, you can see that even after i get that error, i go back to my project listing and under the "Project Images" column , it gives me the number of images associated with that entry. then when i click on the number in that column, it gives me a blank page.

does anyone know what's going on here?

Attachments

I was looking at the error logs from a day ago, and this might be related to what's happening:

Call to a member function get() on a non-object in /root/site/symphony/content/content.publish.php on line 406, referer: http://site.com/symphony/publish/project-images/new/?prepopulate[64]=388

which seems to refer to this line:

$entry->setDataFromPost(array($field->get('element_name') => $value), $error, true);

i'll check the logs again to see if this is the error I've been getting while trying to debug things today.

anyone any clue why this might have happened?

hmm, sounds like the entry is failing to be created after the image has been uploaded. Is this a live site? I could take a look for you. Does it happen consistently?

ya, alistair, this has actually happened to every single entry that has already had images associated with it. it is also on a live server if you want to take a look.

email me at wtdtan [at] gmail

Found the reason. Open up /lib/toolkit/fields/field.upload.php and add the following code somewhere:

function buildSortingSQL(&$joins, &$where, &$sort, $order='ASC'){
    $joins .= "INNER JOIN `sym_entries_data_".$this->get('id')."` AS `ed` ON (`e`.`id` = `ed`.`entry_id`) ";
    $sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "`ed`.`file` $order");
}

The entries were created correctly. It was just during the retrieval that a SQL error occurred.

thanks alistair. looks to be working now.

@Alistair, I think this code may need to be added to the field.upload.php file. When I copied over another fix you had for that file to retain the meta information, I got this same issue again. once I readded this fix, the issue went away.

I can confirm:

  • the bug (it suddenly occured in my 2.0 stable installation, in a section that has section links from another section)
  • the solution Alistair posted above

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details