Possible Bug: duplicate datarecord when using image twice

Phoca Gallery - image gallery extension
H0shi
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 28 Aug 2009, 11:51

Possible Bug: duplicate datarecord when using image twice

Post by H0shi »

If you create a new datarecord and use an image, which is already used in the gallery, then the new dataset is saved twice.
Please see the screenshot.

Image

#15 "test 1" is the first entry
#16 "test 2" is the second entry
#17 "test 2" is the doubled entry

Someone has a solution for this?

Thanks in advance!
H0shi
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Possible Bug: duplicate datarecord when using image twice

Post by Jan »

Hi, as the same image can be saved in different categories with different names this is OK. Phoca Gallery use database and filesystem layer which is not the same, so image stored on your server can be added into more categories and can have other name too.

Jan
If you find Phoca extensions useful, please support the project
H0shi
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 28 Aug 2009, 11:51

Re: Possible Bug: duplicate datarecord when using image twice

Post by H0shi »

Good morning Jan,
thanks for your prompt answer!
I think you slightly missed the point.

Again the steps to the Bug:

1. Create an Image recordset and upload an Image to the Gallery
2. then create another recordset, but instead of uploading another new image, use the image uploaded in step 1.

The result should be two different recordsets with the same picture.
But the actual result is: three recordsets! The one created in step 1 and the second recordset is written twice in the database.

I hope my description was not too abstract...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Possible Bug: duplicate datarecord when using image twice

Post by Jan »

Hi, thank you for this information, now I see it. I confirm, it is a bug. There is an obsolete code in:

administrator\components\com_phocagallery\controllers\phocagallery.php

on line cca 133:

This code should be commented, FROM:

Code: Select all

    if ($model->store($post)) {
            $msg = JText::_( 'Phoca gallery Saved' );
        } else {
            $msg = JText::_( 'Error Saving Phoca gallery' );
        } 
TO:

Code: Select all

/*    if ($model->store($post)) {
            $msg = JText::_( 'Phoca gallery Saved' );
        } else {
            $msg = JText::_( 'Error Saving Phoca gallery' );
        }*/ 
for now. I will fix it in the next release.

Thank you, Jan
If you find Phoca extensions useful, please support the project
Post Reply