Issue saving accessuserid, uploaduserid and deleteuserid

Phoca Download - download manager
jerri
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 11 Sep 2014, 10:21

Issue saving accessuserid, uploaduserid and deleteuserid

Post by jerri »

Hi,

First of all, big thanks for your great components. :)

I just found a bug in PhocaDownload 2.1.9 - when trying to save acces, upload and delete rights for a category it would just save it as "Array" in the database. Or if I choose multiple accesgroups it would write "Array, Array, Array" in the database.

So I looked in administrator/components/com_phocadownload/models/phocadownloadcat.php and found this:
$data['accessuserid'] = implode(',',$accessUserIdArray);
$data['uploaduserid'] = implode(',',$uploadUserIdArray);
$data['deleteuserid'] = implode(',',$deleteUserIdArray);

And my colleague Sune replaced it with a quickfix:
$userIds = array();
foreach ($accessUserIdArray AS $accessUserId)
{
$userIds[] = implode(',',$accessUserId);
}
$data['accessuserid'] = implode(',',$userIds);

$uploadIds = array();
foreach ($uploadUserIdArray AS $uploadUserId)
{
$uploadIds[] = implode(',',$uploadUserId);
}
$data['uploaduserid'] = implode(',',$uploadIds);


$deleteIds = array();
foreach ($deleteUserIdArray AS $deleteUserId)
{
$deleteIds[] = implode(',',$deleteUserId);
}
$data['deleteuserid'] = implode(',',$deleteIds);

Now it is working, but it's a corehack so I can't update the component in the future without loosing the changes, so I wanted you to know my findings and what Sune did to fix it.

Cheers,
Jerri
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Issue saving accessuserid, uploaduserid and deleteuserid

Post by Jan »

Hi, in which Joomla! version did you install Phoca Download 2.1.9?

Jan
If you find Phoca extensions useful, please support the project
jerri
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 11 Sep 2014, 10:21

Re: Issue saving accessuserid, uploaduserid and deleteuserid

Post by jerri »

Hi Jan,

In version Joomla! 2.5.24

Cheers,
Jerri
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Issue saving accessuserid, uploaduserid and deleteuserid

Post by Jan »

Hi, hmmm, testing different values, get no such problem :idea:

See image:
Image

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