Hi,

I' ve got a big problem on a multilanguage-system (en/de). English is the source-language.
When I create a gallery and load some pictures up, the directories are built like it should be: /gallery_assist/1/gallery_assistNODEID (because I'm User 1)
If I then create a translation of this gallery, all directories and files in /1/ are deleted and it seems like the system deletes gallery_assist and 1 also and recreates it.
Here's the output (in german):
* Das Verzeichnis sites/default/files/gallery_assist/1/gallery_assist58 wurde erstellt.
* Das Verzeichnis sites/default/files/gallery_assist/1/gallery_assist58/img wurde erstellt.
* Das Verzeichnis sites/default/files/gallery_assist/1/gallery_assist58/thm wurde erstellt.
* Das Verzeichnis sites/default/files/gallery_assist/1/gallery_assist58/prev wurde erstellt.
* The new owner of this gallery is user: cDmondo
* Eine Beitragsübersetzung wurde synchronisiert.
* Gallery 2009-10-11 - Ralf Kronmüller Schlossrestaurant Sondershausen, Thüringen, Deutschland wurde erstellt.
* Das Verzeichnis sites/default/files/gallery_assist wurde erstellt.
* Das Verzeichnis sites/default/files/gallery_assist/1 wurde erstellt.
You see, in the last two rows the two directories are recreated.
I' ve tested many workarounds but nothing worked.
Allways when a direct translation is created/saved or if I create a german gallery and I assign it to an english gallery as a translation and save it, the directories are deleted and recreated.

Any ideas?

Comments

Natzrut’s picture

Another thing I found out:
When I click the save button, the directories are rebuilt also. And in that case it doesn't matter, if I'm in a translated gallery or in the original one.

So maybe with a "if directory exists" it would be fixed.....but I'm not a good php developer, so I don't know where to put it in the code ;O)

Thanx in advance,
Rainer

Natzrut’s picture

I've tested again and again and the directories are still deleted. I uninstalled gallery_assist_lightboxes but no change...
Here are the messages that I get if I click the save button (now in english ;O)

* The directory sites/default/files/gallery_assist/1/gallery_assist52 has been created.
* The directory sites/default/files/gallery_assist/1/gallery_assist52/img has been created.
* The directory sites/default/files/gallery_assist/1/gallery_assist52/thm has been created.
* The directory sites/default/files/gallery_assist/1/gallery_assist52/prev has been created.
* The new owner of this gallery is user: cDmondo
* One node translation has been synchronized.
* Gallery 2009-10-10 - Drive to Berlin has been updated.
* The directory sites/default/files/gallery_assist has been created.
* The directory sites/default/files/gallery_assist/1 has been created.

There were two directories inside /1/
They are gone..... :O(

jcmc’s picture

Hallo Reiner,
ich hatte deine Meldung schon heute früh gelesen und suche schon nach der Ursache.
Ich kann den Bug nicht reproduzieren. Kannst Du mir dabei helfen den zu erzeugen?

Ich habe in pruebas.puntolatinoclub.de eine Test Installation für Fälle wie dieses.
Benutzername: Natzrut
Passwort Tester_19 - ändern

Bitte informiere mich danach, damit ich Dir die Administrator Rechte zuweise.

bis dann
Juan Carlos

Natzrut’s picture

Hallo Juan Carlos,

habe mich jetzt eingeloggt und das Passwort geändert.
Danke für die schnelle Reaktion.

Grüße,
Rainer

Natzrut’s picture

Eigenartig ist halt, dass die (Unter-)Verzeichnisse angelegt werden und dann dadurch überschrieben werden, dass gallery_assist und 1 nochmal angelegt wird. Und damit sind natürlich sämtliche Ordner im Verzeichnis gallery_assist weg.

Bei den Einstellungen habe ich "rename" gewählt.

alexeyal1’s picture

Promted text
You use the scheduler? For placing of news? At me a similar problem: #667732: The loaded photos leave

Original text
Случайно планировщиком не пользуетесь? Для размещения новостей? У меня похожая проблема: #667732: The loaded photos leave

Natzrut’s picture

No, I've got no scheduler, so the directories disapear when I click on the save button.
I read your post and I think it's a similar problem...in your case it's the scheduler which "saves" the content and the directories are rebuilt.
Maybe Juan Carlos and me we can reproduce it on his system...

alexeyal1’s picture

Promted text
Small addition on #667732: The loaded photos leave. The scheduler can keep any document, unessentially gallery. And at preservation gallery files leave.

Original text
Небольшое дополнение для #667732: The loaded photos leave. Планировщик может сохранять любой документ, необязательно галерею. И при сохранении удаляются файлы галереи.

Natzrut’s picture

Now I found out, that the directories are rebuilt, if you have formally installed the image-module. If so, there's no other way than reinstalling the whole drupal. No chance by uninstalling the image-module.
I hope that helps.

Rainer

jcmc’s picture

Status: Active » Fixed

Hello Natzrut,

http://drupal.org/node/715664
It is not exactly the same issue but maybe have relation to the above link.

There is a patch to solve the issue , images desapear by revert revisions.

I change the status to fixed.

In case some body find it is not fixed the issue should change the status to active again.

Regards
Juan Carlos

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Haarht’s picture

Is this issue fixed with the 1.9 recently released ? This is a highly critical bug which prevents me from putting a website to production. I'm not able to give a step-by-step procedure to reproduce it, but I regularly lose all galleries on my test site (1.9-rc2). Thanks in advance.

jcmc’s picture

Status: Closed (fixed) » Active

Hello Haarht,

I never got this issue in my installations and never have reached to reproduce it but I have some changes implemented to prevent it.

I have added some restrictions in the hook_delete to avoid the "not wanted deletion" of gallery folders because only from this hook can be reached, the deleting files and folders function.

  //
  // this condition checks if by NODE EDIT the buttoms "Delete" and after this the Confirm Deletion was clicked.
  // 
  if ($_POST['form_id'] == 'node_delete_confirm' && $_POST['confirm'] == 1) {
    $delete = TRUE;
  }
  //
  // this condition checks if by ADMINISTER CONTENT nodes was checked, the bulk operation "Delete" was selected and after this the Confirm Deletion was clicked.
  // 
  elseif ($_POST['form_id'] == 'node_admin_content' && $_POST['operation'] == 'delete' && $_POST['confirm'] == 1) {
    $delete = TRUE;
  }
  else {
    $delete = FALSE;
  }

  if ($delete && !empty($node->ref)) {

    if (user_access('delete own gallery_assist content', $user) ||
        user_access('delete any gallery_assist content', $user) ||
        user_access('delete own gallery_assist_'. $node->type .' content', $user) ||
        user_access('delete any gallery_assist_'. $node->type .' content', $user)) {

I think and hope the added changes avoid realy a "not wanted" deletion of gallery folders/files.

Regards
Juan Carlos

PS
I recomende to update to the 1.9 version.

almalino’s picture

this is very similar problem to:
http://drupal.org/node/755130

Every time I update a node with Gallery enabled ALL gallery assit folders gets deleted :(

Hopefully implemented work around will fix it.

jcmc’s picture

Yes almalino,

I know and I not understand why in some installations exist this problem. For example your. I am interest to investigate what is the cause but as before mentioned I can't reproduce the issue.

Can you test the 1.9 version and give me feedback???

Thanks in advance and regards
Juan Carlos

almalino’s picture

Hi Juan,

thank you for great work! :)

I do have 6.x-1.9-rc2 in my installation and it deleted directories. Do you propose to try latest development version?

Another solution could be if I send to you a complete Drupal Directory ZIP file and DB archive so that you will be able to instal my Drupal installation on your computer and try to reproduce the issue. What you think?

jcmc’s picture

Very good Idea almalino,

if this allow me to reproduce the issue, this would be the best to fix this unpleasant issue.

send me the all necessary data.

I sent to you a privat mesage so you have my adress

Regards

almalino’s picture

Juan, all data has been sent to your e-mail.

Haarht’s picture

Hi ! I've been extensively testing the latest stable release and as far as I can tell, the deletion of directories never occurred since the update. Thanks !

jcmc’s picture

Status: Active » Fixed

thanks Haarht,
thanks almalino,

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.