ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SafeCracker File PHP Error

August 24, 2012 10:12am

Subscribe [2]
  • #1 / Aug 24, 2012 10:12am

    Benjamin Kohl

    10 posts

    I believe the error that was discussed in this thread (http://ellislab.com/forums/viewthread/202541/) has returned in EE 2.5.2. In this version, the error reads :

    Fatal error: Call to a member function result() on a non-object in /[DOCUMENT ROOT AND SYSTEM PATH]/expressionengine/third_party/safecracker_file/ft.safecracker_file.php on line 662

    I tried the proposed solution of manually placing a file in the upload folder, but that didn’t fix it. I also made sure the folder permissions were correct. I did a comparison between ft.safecracker_file.php in EE 2.5.2 and EE 2.4.0 which is running on one of our other sites and I see that there used to be a check for the results before the foreach was attempted. I manually reinserted the check and that seems to take care of it.

    EE 2.4.0

    // Put database files into list
      if ($files_from_db['results'] !== FALSE)
      {
       foreach ($files_from_db['results']->result() as $file)
       {
        $files[$file->file_name] = $file->file_name;
       }
      }

    EE 2.5.2

    // Put database files into list
      foreach ($files_from_db['results']->result() as $file)
      {
       $files[$file->file_name] = $file->file_name;
      }
  • #2 / Aug 24, 2012 5:34pm

    Dan Decker

    7338 posts

    Hi Benjamin,

    Thanks for bringing this to our attention!

    I need some clarity here though. Was this an update to an existing installation? We do a really poor job of making sure that safecracker_file gets accounted for. If you follow the instructions, you would actually end up with an out-of-date version of SafeCracker File installed.

    If it’s not an update, then we need to investigate a little deeper.

    Thanks!

  • #3 / Aug 25, 2012 9:42am

    Benjamin Kohl

    10 posts

    It was updated sometime recently so that’s probably what the problem is.

  • #4 / Aug 27, 2012 1:23pm

    Kevin Smith

    4784 posts

    Hi Benjamin,

    Have you checked to make sure you’re using the most recent version of SafeCracker File then? If so, does that clear up the issues you’re having?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases