Jump to:

517 Posts in 247 Topics by 260 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » ss 2.4 and upload problem.

Forum for content editors and CMS users.

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

Page: 1 2
Go to End
Author Topic: 2511 Views
  • HanSolo
    Avatar
    Community Member
    83 Posts

    ss 2.4 and upload problem. Link to this post

    I recently upgraded to 2.4. And now I cant upload images or files anymore.
    When i click on the upload button i get " file is not a valid upload!"

    I did search teh forum, and I found that more people than I had the same problem, but noone had found an answer for the problem.

    So I hope someone can point me in the right direction. I do have some more sites I would like to upgrade to SS 2.4 but if there is no solution for the upload problem then SS 2.4 cant be a stable release in my opinion. Should I wait for SS 2.4.1?

    Joakim

  • qlex
    Avatar
    Community Member
    68 Posts

    Re: ss 2.4 and upload problem. Link to this post

    HanSolo, did u eventually solve your problem ?
    I now upgraded my client to 2.4.1 and have an upload problem - admin can upload, user can't upload.
    do you have swfupload installed ?

    qlex

  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: ss 2.4 and upload problem. Link to this post

    Had the same problem on one hosting.

    Everything works fine on my computer and another hostings just one had such problem.
    "Files and Images" works fine, but when i was clicking "add image" in TinyMCE and Upload then, i got that error.

    It was fixed after I modified sapphire/filesystem/Upload.php function validate()

    I just moved
    $pathInfo = pathinfo($this->tmpFile['name']);
    before
    if(isset($this->tmpFile['tmp_name']) && !is_uploaded_file($this->tmpFile['tmp_name']) && !SapphireTest::is_running_test())

    I tried to remove conditions to parse params, but got nothing ... it's very strange, but now it's working.

  • qlex
    Avatar
    Community Member
    68 Posts

    Re: ss 2.4 and upload problem. Link to this post

    Tonyair:
    tried to follow your suggestion. No change
    When i click "add files to "Uploads" button, the lightbox comes up with the following error:

    [User Error] Bad RecordClassName '' and $baseClass not set
    GET /[sitename]/admin/assets/EditForm/field/Files/upload

    Line 2761 in [sitedir]/sapphire/core/model/DataObject.php

    Source

    2752       foreach($records as $record) {
    2753          if(empty($record['RecordClassName'])) {
    2754             $record['RecordClassName'] = $record['ClassName'];
    2755          }
    2756          if(class_exists($record['RecordClassName'])) {
    2757             $results[] = new $record['RecordClassName']($record);
    2758          } else {
    2759             if(!$baseClass) {
    2760                user_error("Bad RecordClassName '{$record['RecordClassName']}' and "
    2761                   . "\$baseClass not set", E_USER_ERROR);
    2762             } else if(!is_string($baseClass) || !class_exists($baseClass)) {
    2763                user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
    2764                   . "\$baseClass '$baseClass not set", E_USER_ERROR);
    2765             }
    2766             $results[] = new $baseClass($record);
    2767          }

    Trace

    * Bad RecordClassName '' and $baseClass not set
    Line 2761 of DataObject.php
    * DataObject->buildDataObjectSet(MySQLQuery,DataObjectSet)
    Line 739 of File.php
    * File->instance_get(ClassName != 'Folder' AND ParentID = 80,,,,DataObjectSet)
    Line 2713 of DataObject.php
    * DataObject::get(File,ClassName != 'Folder' AND ParentID = 80)
    Line 145 of FileDataObjectManager.php
    * FileDataObjectManager->getImportFolderHierarchy(79,2)
    Line 148 of FileDataObjectManager.php
    * FileDataObjectManager->getImportFolderHierarchy(78,1)
    Line 148 of FileDataObjectManager.php
    * FileDataObjectManager->getImportFolderHierarchy(0)
    Line 130 of FileDataObjectManager.php
    * FileDataObjectManager->ImportDropdown()
    Line 321 of FileDataObjectManager.php
    * FileDataObjectManager->UploadForm()
    Line 227 of FileDataObjectManager.php
    * FileDataObjectManager->upload(SS_HTTPRequest)
    Line 137 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 155 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 155 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    * Controller->handleRequest(SS_HTTPRequest)
    Line 281 of Director.php
    * Director::handleRequest(SS_HTTPRequest,Session)
    Line 124 of Director.php
    * Director::direct(/admin/assets/EditForm/field/Files/upload)
    Line 127 of main.php

  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: ss 2.4 and upload problem. Link to this post

    is this swfupload?

  • qlex
    Avatar
    Community Member
    68 Posts

    Re: ss 2.4 and upload problem. Link to this post

    Tonyair: yes it is.
    When adding uploadify, there's no change. If i remove swfupload and leave dom and uploadify only, i get an DOM error insisting on installing swfupload. This might change when UncleCheese brings uploadify support for dom ?

  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: ss 2.4 and upload problem. Link to this post

    Maybe, but actually I use only DOM and swfupload, i can attach my swfupload version with the latest swfupload version and user side image resizing if u need

  • qlex
    Avatar
    Community Member
    68 Posts

    Re: ss 2.4 and upload problem. Link to this post

    Please do, i will see if that helps.

    2511 Views
Page: 1 2
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.