Jump to:

7937 Posts in 1537 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » SWFUpload: auto logout and processing stuck

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1235 Views
  • Anatol
    Avatar
    126 Posts

    SWFUpload: auto logout and processing stuck Link to this post

    Hi,

    I use the latest (trunk) version of SWFUpload (rev 432), DataUploadManager (rev 432) and the Gallery and Silverstripe 4.1.

    I have some problems that appeared in earlier forum posts (e.g. here and here) but none of the solutions helped.

    I tried to

    • * update everything to the latest trunk version.

    • * set the assets folder permissions to recursive 777

    • * session.use_only_cookies is off

    • * SWFUploadField.php contains SWFUploadConfig::addPostParam('PHPSESSID',session_id());

    • * I tried some small patches to Sapphire that were mentioned in another related post (didn't help so I reverted the changes)

    • * and a number of other things that didn't seem to work

    Here is the SWFUpload debug of the failed upload.

    The upload fails in the CMS in the "Files & Images" tab.

    However, the upload works perfectly well in the CMS "Pages" tab when I add images to a gallery. It shows "processing" and then "completed". No issues. Here is the "healthy" debug.

    What I also notice is that every time I upload or try to upload images (both in the "Files & Images" and the "Pages" tab I get logged out. I'm just guessing but this might be connected to the problem.

    I'm looking forward to the new module that will replace the SWFUploader but for the meanwhile I hope I'll find a way to fix the issue so that my client can use the site properly.

    I need SWFUpload for the gallery, otherwise I get a fatal error. Or is there any way to disable SWFUpload except for the gallery module or Dataobject Manager? I know that the built-in "Files & Images" uploader works.

    Any hint is appreciated. I really don't know what else I could try.

    Cheers!
    Anatol

  • Anatol
    Avatar
    126 Posts

    Re: SWFUpload: auto logout and processing stuck Link to this post

    Hi again,

    OK, here is a (temporary) solution for my problem. Hopefully until I can replace it with the new replacement module for SWFUpload. Very very very very very ugly ... you have been warned. I'm off on holiday on Friday and I don't want to take a heavy suitcase of coding problems with me and leave an unhappy client behind.

    I simply added the if condition below around all code of the following files:

    /swfupload/code/SWFUploadField.php
    /dataobject_manager/_config.php
    /dataobject_manager/code/DataObjectManager.php

    Added code in green:

    <?php
    if (!preg_match("/^\/admin\/assets\//",$_SERVER["REQUEST_URI"])) {

    class SWFUploadField extends FileField
    {
    ...etc...
    }

    }
    ?>

    So just ignore any of the code of all 3 files if we are in the Assets area, i.e. "Files & Images". So the Assets area uses the default file upload field.

    I told you it was ugly - but it does the trick.

    I still get logged out when I upload images to the gallery, but for now I can live with that. I'm very much looking forward to the new module though!

    Oh, and if anyone does have a more elegant solution or can solve my problem as described above please please do post!

    Cheers!
    Anatol

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload: auto logout and processing stuck Link to this post

    DataObjectManager::allow_assets_override(false);

  • Anatol
    Avatar
    126 Posts

    Re: SWFUpload: auto logout and processing stuck Link to this post

    Perfect! Thank you!

  • craesh
    Avatar
    Community Member
    25 Posts

    Re: SWFUpload: auto logout and processing stuck Link to this post

    UncleCheese, can you document that in http://doc.silverstripe.org/modules:swfuploadfield? Thanks!

    1235 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.