Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

SWFUpload: auto logout and processing stuck


Go to End


5 Posts   1718 Views

Avatar
Anatol

126 Posts

18 August 2010 at 10:05pm

Edited: 18/08/2010 10:11pm

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

Avatar
Anatol

126 Posts

18 August 2010 at 11:26pm

Edited: 18/08/2010 11:32pm

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 August 2010 at 1:37am

DataObjectManager::allow_assets_override(false);

Avatar
Anatol

126 Posts

19 August 2010 at 11:27am

Perfect! Thank you!

Avatar
craesh

Community Member, 25 Posts

7 September 2010 at 1:48am

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