Recent Topics

[Bug ? 6.9.7] All files lost in media/photos !

Started by on Jun 19, 2018 – Contents updated: Jun 26, 2018

Jun 19, 2018 16:41    

Hello,
I use a photoblog since a long time.
I wanted to create a new photo album dedicated to a single user, using the skin "Bootstrap Gallery Skin" or "Photo Albums".
So I created one = Site / Nouvelle collection.I selected the type "Gallery".
The name proposed was "photos" and since I already used this name for my old photoblog, I changed it to "images".
I logged as a newly created user, and after some trials, I found it too complicate to set the authorizations of this user to allow only photos uploads in the new blog.
I decided to give up and to suppress the newly created blog.
I had a warning saying that it was irreversible. Ok.
But then when I wanted to look some of my photoblog posts no images were displayed.
I discovered that all files were erased in the media/photos directory !!!
No problem, I recovered the lost files using the last night backup,but this is frightening !

Can you tell what goes wrong ?
Were the files erased when the new photo album was created ?
Or were they erased whed I suppressed the new blog ?
Is it a bug or did I do something wrong ?

Jun 19, 2018 18:12

Maybe you linked your new site to the old media files and if they were therefore still in the original directory, you deleted them when you dumped the new collection. Scary!

It's a bit late now but the back office does say where the media files for each collection is stored.

Jun 20, 2018 01:09

If the photos were stored in the media folder of the collection you deleted, then yes it is normal that they were deleted along with it.
There is a message that says so.
This is done so that people don't end up with huge unused folders on their web hosting accounts.

Jun 20, 2018 08:25

@fplanque wrote earlier:

If the photos were stored in the media folder of the collection you deleted, then yes it is normal that they were deleted along with it.

François, may be you missed the fact that I changed the name of the url to "images" instead of "photos". I thought that it means that the new default dir would be "images" NOT "photos" ! there is at least an ambiguity in the process... If not a bug.

If the "normal" behavior of b2 is to link any new photoblog to the dir "photos" whatever the settings choosen by the user, then it is a real problem ! Think : if you just want to try a new photo blog, then you never can delete it unless you loose all your media/photo files :(

regards.
Jacques

Jun 20, 2018 08:28

@amoun wrote earlier:

Maybe you linked your new site to the old media files and if they were therefore still in the original directory, you deleted them when you dumped the new collection. Scary!
It's a bit late now but the back office does say where the media files for each collection is stored.

amoun, thanks for the reply. Please see my answer to François.
regards.
Jacques

Jun 20, 2018 13:28

@lefataliste
Hi again
I've created and deleted many collections without problems with the media files.
I'm using 6.10.1 to try and replicate your issue.

  1. I can't create a second gallery with the same name and then change it. In other words I was not prompted to use 'Photos' as it already existed. So did you create the 'Photos' folder manually?
  2. Whereas if I create a new collection with the name 'Images' b2evo does create a respective folder in /media/blogs/ no such folder is created using the default 'Photos'
  3. If I ignore the warning it does create a blog with the same name but then creates a folder /media/blogs/photos-1
  4. I can change the name of the second 'Photos' collection to 'images' and leave the /media/blogs/photos-1 as is.
  5. Deleting the images collection only removes the /media/blogs/photos-1 it was linked to

The problem I have is that no /media/blogs/photos/ was created for the first 'Photo Blog' so how such a folder existed I don't know unless you created it, or there is an error in it's omission. But when I created one by ftp manually and then deleted the collection it did remove the manually created folder.

So something is bit odd with the fact that no /media/blogs/photos/ was created in the first place and somehow you must have conflicted the names in creation and thereby deleted the folder with your content.

Well that's some ideas ??

Jun 20, 2018 14:03

I am not in front of a computer and cannot test this right now but if someone could try to reproduce this it would be great:

  1. Create a gallery collection with a name “one”
  2. Check that the media folder is created as ˋmedia/blogs/oneˋ
  3. Rename the collection to “two”
  4. Check if it renames the media folder automatically to ˋmedia/blogs/twoˋ
  5. Recreate another collection called ‘one’ just to see if a confusion will take place
  6. Delete the collection now called ‘two’
    • check if it clearly says what media folder it’s going to delete
  7. Check if it deleted the expected folder

(We’ll test that if you no one else does but I can’t say exactly when)

Jun 20, 2018 16:34

@amoun wrote earlier:

@lefataliste
Hi again
I've created and deleted many collections without problems with the media files.
I'm using 6.10.1 to try and replicate your issue.
[...] So something is bit odd with the fact that no /media/blogs/photos/ was created in the first place and somehow you must have conflicted the names in creation and thereby deleted the folder with your content.


Hi amoun,

  1. I'm sorry, but as I said in my original post, I created my photoblog a long time ago, with b2 v4, and I do not remember how the photos dir was created - but I believe NOT using ftp, just setting the name in the blog creation page.
  2. I'm presently still using v6.9, and when creating the new collection, I selected the "create empty collection" option.
  3. then it is a possibility that I wanted to have the same photos sub-dir as the previoulsy created photoblog and stupidely change the name from "photos-1" to "photos" ? before changing it again to "images". I've no idea at what moment the photos dir was emptied : when creating the new collection or when deleting it ?

I shall try to reproduce what I did as François sugests. But this will not be in the next hours since I'm engaged in another urgent job.
Thanks again. I'll come back to this a little bit later on.
regards.
Jacques

Jun 20, 2018 17:02

@fplanque

The problem is not quite as you imagine and I stated earlier.

  1. No ˋmedia/blogs/photosˋ is created if using the default name.
  2. The creator has to actively change the 'Short Title' and the 'URL Filename'. The URL Filename does not change on changing the 'Short Title'
  3. Can not create a second collection called one whilst there is a media folder still called one
  4. Changed Full name to Three, Short Name is Two, and media folder is still One
  5. Deleting a collection only refers to the Full Name in this case Three and deletes the media folder One

  1. Create a gallery collection with a name “one” .................. OK
  2. Check that the media folder is created as ˋmedia/blogs/oneˋ .................. OK
  3. Rename the collection to “two” .................OK
  4. Check if it renames the media folder automatically to ˋmedia/blogs/twoˋ ............ NO it does not
  5. Recreate another collection called ‘one’ just to see if a confusion will take place ............ CAN NOT do so

Jun 20, 2018 18:04

@lefataliste

At some point it seems you created a /media/blogs/photos/ which is recorded in the database.
5b/ as there was already a folder called photos,b2evo offered you /photos-1/
If the folder was created by ftp then as there would be no record it would have offered /photos/ which as I have mentioned doesn't get created.

I created a folder /media/blogs/photos/ by ftp
I created two collections with the same name Photos.
The first automatically used the URL Photos, which would NOT have been made if I didn't do it by ftp.
The second prompted a new URL as /photos-1/ which I accepted.
I then received a message that the files had been moved (first image)
The /media/blogs/photos/ I made by FTP has either been deleted or my likely the file name changed.
There is now no /media/blogs/photos/

So

The /media/blogs/photos/ was deleted ???? but I have two collections called Photos but only one /media/blogs/photos-1/
So if I delete the second collection I will delete all the files that have now been moved

Jun 21, 2018 01:40

@lefataliste It should be impossible to create a new blog using URL filename photos if it's already in use by another collection. See screenshot below.

I don't understand how you can link 2 collections to the photos media dir.

Are you running on Windows or some OS using non case sensitive filenames and maybe you have photos vs photos ?

Jun 21, 2018 10:51

@fplanque
yes this is what I have said in post #9 'Can not create a second collection called one whilst there is a media folder still called one'

but when creating a collection with an identical name, and having to use a new name for the media folder, b2evo changes the name of the original media file to the new name, so the original collection has no media folder. If you then delete the new collection, which has the same name as the original you delete the original media folder as it has been renamed to the new.

This only happens with a 'Photos' collection if I make a media folder 'photos', the second being named 'photos-1' as b2evo dosen't make the initial 'photos' folder.

Even if I use different case Photos or photos for the media the folder name is overwritten by photos-1 when I make a second collection called Photos

Jun 21, 2018 13:20

@lefataliste wrote earlier:

François, I wanted to test that.
1/ Site
2/ new collection
3/ Gallery
4/ select bootstrap gallery skin
5/ In the param page
a/ create empty collection
b/ I'm proposed with Title = Photos ; Short name = Photos ; "File name" URL = photos-1
c/ I want to keep "Photos" as the title
d/ I try "one" as the short name => this puts "one" in the url
e/ I try to keep "Photos" as short name => this puts "photos" in the url
f/ I revert to "one"
g/ I validate and get an error message saying that something was already in use (I'm sorry but I did not capture the message)
h/ RESULT => ALL MY FILES IN THE photos SUBDIR LOST AGAIN!
grrrr

I forgot to say that a "one" subdir was indeed created in the media/blogs dir AND that it contains all my files previously in the "photos" subdir. (in fact I did not check by ftp until now).
Another point : I persist to say that I DID NOT create the "photos" subdir by ftp ! It was regularly created through the b2evo procedure. Everything was going well since the time of creation around 2011 with b2evo v4.
regards.
Jacques

Jun 21, 2018 17:46

I could not quickly reproduce this but we will check again.

Jun 26, 2018 08:29

@yurabakhtin wrote earlier:

Hello @lefataliste, you are right, it was a bug, we are sorry about this.
[...] Thank you for the report.

Ok. This had no lasting impact. Thank you for your involvement and for all the good programming.
Cordialement
Jacques

This post has 2 feedbacks awaiting moderation...


Form is loading...

powered by b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.