Hi.
We found a bug because, in filelist mode, we have other files from other categories and whatever the category.
My hypothesis is that there is confusion, at the plugin level, between the category ID and the ID of other files (which are not in the category to list).
Indeed, it is sufficient that there is a 6 (62, 68) in the ID of the file and it is also added to the list of files of category 6.
On website, 2 files from another category :
In filelist, both file's ID is 6x (and another problem is that plugin does not take into account the publication status) :
Bug in content plugin : file id confused with category id
-
- Phoca Enthusiast
- Posts: 52
- Joined: 24 Jul 2018, 16:33
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bug in content plugin : file id confused with category id
Hi, can you paste a plugin code you are using in your content?
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 52
- Joined: 24 Jul 2018, 16:33
Re: Bug in content plugin : file id confused with category id
Code: Select all
{phocadownload view=filelist|id=6|target=b}
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bug in content plugin : file id confused with category id
The flow is following:
id stored in variable $id
c.id ==>
In words, the id is category ID, so the SQL query selects all items based on category ID.
I don't see any other use of ID in other part. The ID is used once in the SQL query - compared to category ID:
So, I don't exactly understand what do you mean with: "the category ID and the ID of other files"?
Jan
Code: Select all
else if($values[0]=='id') {$id = $values[1];}
Code: Select all
case 'filelist':
Code: Select all
if ((int)$id > 0) {
$query .= ' WHERE c.id = '.(int)$id;
Code: Select all
. ' LEFT JOIN #__phocadownload_categories AS c ON a.catid = c.id';
I don't see any other use of ID in other part. The ID is used once in the SQL query - compared to category ID:
So, I don't exactly understand what do you mean with: "the category ID and the ID of other files"?
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 52
- Joined: 24 Jul 2018, 16:33
Re: Bug in content plugin : file id confused with category id
Thank you for your answer.
It was a guess, maybe I got too far ahead in the title of the post.
However, after several tests, the fact is that documents of another category - and regardless of the category, I tried to move them, etc. - appear in the list when they should not.
I try to redo the list by hiding (CSS display:none) the extra elements in order to show you on this page (module on the right, titled "Documents"): www.yens.ch/services-communaux/dechetterie
You should recognize the documents on both screenshots sent the other day. Thank you in advance!
It was a guess, maybe I got too far ahead in the title of the post.
However, after several tests, the fact is that documents of another category - and regardless of the category, I tried to move them, etc. - appear in the list when they should not.
I try to redo the list by hiding (CSS display:none) the extra elements in order to show you on this page (module on the right, titled "Documents"): www.yens.ch/services-communaux/dechetterie
You should recognize the documents on both screenshots sent the other day. Thank you in advance!
-
- Phoca Enthusiast
- Posts: 52
- Joined: 24 Jul 2018, 16:33
Re: Bug in content plugin : file id confused with category id
You're right, it's another problem. I change one of the id form 65 to 11 and file is always displayed even it's not the right category.
Sorry, it's because I hacked your plugin (see viewtopic.php?f=31&t=62408) and I now have where AND and OR conditions. Sorry for the inconvenience and strongly that the feature request is granted!
Best regards
Sorry, it's because I hacked your plugin (see viewtopic.php?f=31&t=62408) and I now have where AND and OR conditions. Sorry for the inconvenience and strongly that the feature request is granted!
Best regards
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bug in content plugin : file id confused with category id
Ok
If you find Phoca extensions useful, please support the project