Search

Is the error from Comment #17 happening because of WORKSPACE being in the General::listDirStructure

$directories = General::listDirStructure(WORKSPACE, null, 'asc', DOCROOT, $ignore);

Any thoughts, I'm stumped or I'm just plain stupid. :)

UPDATE:

I commented out line 40 of field.s3upload.php altogether and still get the same error as Comment #17 after saving the entry. In Firefox, it does upload the file (and in Safari it doesn't upload the file).

STILL GET THIS ERROR

unlink(/Users/defaultuser/Sites/defaultuser.local/public/workspace/): Operation not permitted
    /Users/defaultuser/Sites/defaultuser.local/public/symphony/lib/toolkit/class.general.php line 811

    806      *  true if the file is successfully unlinked, if the unlink fails and
    807      *  silent is set to true then an exception is thrown. if the unlink
    808      *  fails and silent is set to false then this returns false.
    809      */
    810     public static function deleteFile($file, $slient=true){
    811         if(!@unlink($file)){
    812             if($slient == false){
    813                 throw new Exception(__('Unable to remove file - %s', array($file)));
    814             }
    815

I updated this when I was working on the new version of another extension, I'll test it more then post it to github later, perhaps not by the end of today.

You can find version 0.6.2 at github. I added a couple new features, fixed a couple bugs, and made it work with the mass upload utility.

0.6.2

  • If the bucket gets deleted, it won't throw an exception
  • Dealing with the way files stored in the database, so even if you change the CNAME (or remove it), the proper URL will be displayed
  • Fixed editing an entry, it wasn't working with some legacy code!

0.6.1

  • Fixed a problem where an entry wouldn't properly remove itself completely

0.6

  • Now deletes a file from S3 upon deleting an Entry (this is optional and set upon creating a S3 field within a section)
  • You can specify an optional CNAME so the files will generate the proper URL without intervention
  • Bug fixes to get it working with Symphony 2.2
  • You can't add a field to a section until you setup your API keys
  • Added mimetype and size to the XML output

https://github.com/scottkf/s3upload_field/tree/0.6.2

Scott, have you been able to get this extension to work on your end. I tried to get it to work on a 2.2 install, but I was getting an error saying it could not upload to the selected bucket because it already had items in the bucket. And on a new 2.2.1 installation, when setting up a section, it would never recognize any of my buckets from my amazon s3 account.

I updated the DB table that this field uses, so if you have an old version you have to uninstall then reinstall it, if you cant because it's in production use I can write you an update method. I didnt think anyone was currently using it though.

If that doesn't do it, try creating a new bucket and choosing that one. Otherwise, it's a bug of some sort!

I tried it on Symphony 2.2.1 though, but it should work on 2.2.

I'm trying to implement version 0.6.2 presently. The field loads in the section maker. I can choose the bucket I want. However, when I try to upload a file to the bucket it the entry I'm making acts like it starts uploading then refreshes the add entry page, essentially doing nothing.

Could someone help me discern if I'm doing something incorrect here?

Anybody feeling exceptionally benevolent today? Would love you're help.

The file wasn't in the bucket then?

The file wasn't in the bucket then?

@scottkf, thank you for the response. That's correct. I tested the connection with another S3 app and was able to upload the same test file to the bucket no problem.

I just tested the extension for the first time, and it worked perfectly for me. I must say that I am impressed!

(Unfortunately this also means that I have no idea what might go wrong in @wjnielsen's setup.)

Ah! I found a bug! :-)

Deleting the file does seems to not work at all. (Although I set the "delete when entry ids deleted" flag.)

(Shouldn't the file also be deleted when it is removed from in the entry? Is the extension supposed to do this?)

Where should bugs be posted? Who is the active maintainer?

I am fast today...

Let's put it this way: My expectation was different.

If you remove a file from an entry, there is simply no chance to get it removed when the entry is deleted (because the entry doesn't know about the file anymore).

I'd rather see Symphony's standard behaviour here. Kick the file if the file is removed from the entry or the entry is deleted.

You're saying that if you remove the file (by clicking the remove button), then clicking delete, the file won't be removed?

No I say "remove, then save the entry, then click delete".

If you "remove" the file, then save the entry, the file is not deleted. But the reference in the entry is gone. So the file can never again be deleted.

BTW: Which is the "official" repo? Is it yours, @scottkf?

Ah hah! I didn't realize that because I had set the upload field to be required. I pushed the change to the master branch, it should work now. I took over the repo because I was testing it with the mass upload utility and then used for a client's project. So yes, I guess I maintain it now unless Andrew still wants to.

As far as nielsen's problem, is there anything in the log file, any errors at all?

Thanks, it's working great now. Well, apart from the Content-Type not being set for S3 files. I will send a pull request for this, I already figured it out!

There's still an issue where a bucket will get deleted ONLY if you delete an entry with no file, and there are no other files in the list. I'll look at that now, then pull the request when you send it over!

0.6.3

  • Wasn't setting the Content-Type for S3 files, thanks Michael!
  • Accidentally removed bucket if the filename was empty and it was the last file in the bucket
  • Wasn't properly removing files when a file was removed then saved

Thanks for pulling. Should I post my list of wishes now? :-)

What do you think about opening the issue tracker on GitHub? We could discuss one or two things there.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details