Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Admin sticking when I click on Files

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 464 Views
  • jimbeeer
    Avatar
    Community Member
    4 Posts

    Admin sticking when I click on Files Link to this post

    I'm in the admin on v3.1.

    I can navigate around any of the back-end, until I click on Files on the left, then the whole admin sticks and I have to manually delete the 'assets' from the address and refresh the page. I've set the assets folder to 777 but that doesn't seem to have made much difference.

    Anyone know why this is happening?

    Also when I click on 'Upload Image' it just shows 'There has been an error'. I can only suspect the two issues are related.

    -James

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Admin sticking when I click on Files Link to this post

    Hi James,

    My initial advice would be to log errors... e.g.

    SS_Log::add_writer(new SS_LogFileWriter(BASE_PATH . DIRECTORY_SEPARATOR .'logs'. DIRECTORY_SEPARATOR . 'ss_error.log'), SS_Log::WARN, '<=');

    ...and check them!

    Secondly I assume you are in dev mode already? with error report "on"?

    Director::set_environment_type('dev');
    ini_set('display_errors', 1);error_reporting(E_ALL & ~E_STRICT);
    (in _config.php)

  • jimbeeer
    Avatar
    Community Member
    4 Posts

    Re: Admin sticking when I click on Files Link to this post

    Thanks, I didn't know about any of this.

    Here's my error:

    [01-Dec-2013 16:38:01] Error at framework/model/MySQLDatabase.php line 592: Couldn't run query:
    SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName"
    FROM "File"
    WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder'))
    ORDER BY "File"."Name" ASC

    Unknown column 'File.ShowInSearch' in 'field list' (http://prioryschool.com/admin/assets/)

    I've recently upgraded from 2.4 to 3.1 but I haven't done anything to the database. Do I have to upgrade it or something?

    Apologies for my ignorance.

  • quamsta
    Avatar
    Community Member
    29 Posts

    Re: Admin sticking when I click on Files Link to this post

    And you've run /dev/build since upgrading? Even if so, try running it again. The ShowInSearch column should have been available even in SilverStripe 2.4.x.

  • jimbeeer
    Avatar
    Community Member
    4 Posts

    Re: Admin sticking when I click on Files Link to this post

    I hadn't been. But I am now. Here's the error screen I get when I try to refresh the files page:

    [User Error] Couldn't run query: SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder')) ORDER BY "File"."Name" ASC Unknown column 'File.ShowInSearch' in 'field list'
    GET /admin/assets/

    Line 592 in /home/priorysc/public_html/framework/model/MySQLDatabase.php

    ------------------------------------------

    Source

    583    }
    584
    585    public function databaseError($msg, $errorLevel = E_USER_ERROR) {
    586       // try to extract and format query
    587       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
    588          $formatter = new SQLFormatter();
    589          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
    590       }
    591
    592       user_error($msg, $errorLevel);
    593    }
    594
    595    /**
    596     * Return a boolean type-formatted string
    597     *
    598     * @param array $values Contains a tokenised list of info about this data type
    Trace

    Couldn't run query: SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder')) ORDER BY "File"."Name" ASC Unknown column 'File.ShowInSearch' in 'field list'
    MySQLDatabase.php:592
    MySQLDatabase->databaseError(Couldn't run query: SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder')) ORDER BY "File"."Name" ASC | Unknown column 'File.ShowInSearch' in 'field list',256)
    MySQLDatabase.php:144
    MySQLDatabase->query(SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder')) ORDER BY "File"."Name" ASC,256)
    DB.php:200
    DB::query(SELECT DISTINCT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."ShowInSearch", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("ParentID" = 0) AND ("File"."ClassName" IN ('Folder')) ORDER BY "File"."Name" ASC,256)
    SQLQuery.php:945
    SQLQuery->execute()

    464 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.