Jan
Multiple add creates duplicates of everything
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
Hi, in this topic, there are different errors, so maybe this confuses me. Did you make an migrate? Maybe the path to files is wrong so the images are duplicated 
Jan
Jan
If you find Phoca extensions useful, please support the project
-
Meta11icA
- Phoca Newbie

- Posts: 6
- Joined: 14 Aug 2015, 10:43
Re: Multiple add creates duplicates of everything
No, it's a clean install on a clean Joomla. The image paths are OK.
Check the print: http://i.imgur.com/4PzAFSB.png
It's the same image with the same path and it's displayed 3 times in the same category.
Check the print: http://i.imgur.com/4PzAFSB.png
It's the same image with the same path and it's displayed 3 times in the same category.
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
Hi, I see, but I see different IDs (large distances): 45, 212, 520 so this seems like the same images were added to the system but more times in time? Which is the date between the IDs 
Jan
Jan
If you find Phoca extensions useful, please support the project
-
Meta11icA
- Phoca Newbie

- Posts: 6
- Joined: 14 Aug 2015, 10:43
Re: Multiple add creates duplicates of everything
Yes, I have several categories on that site, in all the categories hundreds of new pics need to be added almost daily. After we upload the new images to a category and we use the select all option, all the "old" images are added again to the category thus creating the duplicates.
I don't think this is normal behavior.
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
Hi, it depends on if you select other category or you change the category name.
- if you user multiple add and you have selected category, then the images will be added newly as they go to new category
- or if you have changed the name of category (folder) then the images which were added in past are added again but to new category (when you select whole folder)
Jan
- if you user multiple add and you have selected category, then the images will be added newly as they go to new category
- or if you have changed the name of category (folder) then the images which were added in past are added again but to new category (when you select whole folder)
Jan
If you find Phoca extensions useful, please support the project
-
Meta11icA
- Phoca Newbie

- Posts: 6
- Joined: 14 Aug 2015, 10:43
Re: Multiple add creates duplicates of everything
Ok, let's say I create category "A" in the back-end, and I create folder "1", where I upload 10 images using the multiple add tool. After I've uploaded the images, I use the select all option and add the 10 images to category "A". One day later, I upload another 10 images to folder "1", so now it has 20 images, I use the select all option to add the images to category "A" and I end up with 30 images in category "A", from which 10 are duplicates. I don't change folder/category names in this process. This is my problem...
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
Hi, multiple upload function does work with folders not with categories, see example (you can test it)
Create two folders on your server in images/phocagallery folder, e.g.:
Abc
Def
and upload images to them, e.g. 001.jpg image so you have this structure:
Folder Abc - Image 001.jpg
Folder Def - Image 001.jpg
Now go to Multiple Add function and select both folders (Abc and Def - but don't select any category) - if you click on Save and Close, you get the following:
2 categories made, 2 images added.
Now do the same, select both folders and click on save - now you get:
0 category made, 0 image added
If you change the title of the Category Abc to Abcd and you go to multiple upload and select Abc and Def folder, you get new category there "Abc" (one category - one image) - so you now have Abc, Def, and Abcd
Multiple upload function is a way to import easily and quickly images to the gallery but if you:
- change the name of category (then it is different to folder name and the folder name will be transformed to new category)
- select the category (then it does not more compare folder name and category name and will do duplicates)
- don't change the category name and folder name - such then will not create duplicates
So in this case, selecting the category means, the image will be not ignored but duplicate will be done - but if you select whole folder, duplicates will be not created.
Jan
Create two folders on your server in images/phocagallery folder, e.g.:
Abc
Def
and upload images to them, e.g. 001.jpg image so you have this structure:
Folder Abc - Image 001.jpg
Folder Def - Image 001.jpg
Now go to Multiple Add function and select both folders (Abc and Def - but don't select any category) - if you click on Save and Close, you get the following:
2 categories made, 2 images added.
Now do the same, select both folders and click on save - now you get:
0 category made, 0 image added
If you change the title of the Category Abc to Abcd and you go to multiple upload and select Abc and Def folder, you get new category there "Abc" (one category - one image) - so you now have Abc, Def, and Abcd
Multiple upload function is a way to import easily and quickly images to the gallery but if you:
- change the name of category (then it is different to folder name and the folder name will be transformed to new category)
- select the category (then it does not more compare folder name and category name and will do duplicates)
- don't change the category name and folder name - such then will not create duplicates
So in this case, selecting the category means, the image will be not ignored but duplicate will be done - but if you select whole folder, duplicates will be not created.
Jan
If you find Phoca extensions useful, please support the project
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
See image:

In Phoca Gallery, there is independent database and filesystem layer. This means that image can be stored on server in different places without losing connection to its category, example:
Image 001.jpg is stored in folder "001" - you use multiple add function and this image will be added to system: Category 001, image 001.jpg Then you move the image to category 002 but the path to the image is unchanged images/phocagallery/001/001.jpg
So this means, in Phoca Gallery images stored on server (filenames) and their path is indepentend to database (category).
And this is why the multiple add works as written above:
- if images are selected including folder, then they will added to the system - if there is the same folder name and some images inside it - only new images will be added.
- but if you select category then the image will be added (like it is duplicate but it is not - it gets new ID) - this is because new image cannot overwrite some old which is used in other category (hypothetical).
Jan

In Phoca Gallery, there is independent database and filesystem layer. This means that image can be stored on server in different places without losing connection to its category, example:
Image 001.jpg is stored in folder "001" - you use multiple add function and this image will be added to system: Category 001, image 001.jpg Then you move the image to category 002 but the path to the image is unchanged images/phocagallery/001/001.jpg
So this means, in Phoca Gallery images stored on server (filenames) and their path is indepentend to database (category).
And this is why the multiple add works as written above:
- if images are selected including folder, then they will added to the system - if there is the same folder name and some images inside it - only new images will be added.
- but if you select category then the image will be added (like it is duplicate but it is not - it gets new ID) - this is because new image cannot overwrite some old which is used in other category (hypothetical).
Jan
If you find Phoca extensions useful, please support the project
-
Meta11icA
- Phoca Newbie

- Posts: 6
- Joined: 14 Aug 2015, 10:43
Re: Multiple add creates duplicates of everything
Dear Jan,
Thank you very much for taking time to explain the mechanism to me, now everything is clear, I've remade my gallery with the new knowledge and now everything is working as expected. It's great to know that there are still people actually offering support for their products.
Thank you again and keep up the good work!
Thank you very much for taking time to explain the mechanism to me, now everything is clear, I've remade my gallery with the new knowledge and now everything is working as expected. It's great to know that there are still people actually offering support for their products.
Thank you again and keep up the good work!
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Multiple add creates duplicates of everything
Ok
If you find Phoca extensions useful, please support the project