Page 1 of 1

User upload pre select category

Posted: 03 Jul 2019, 21:12
by JohnD
Hi,
when i create an user upload page in the frontend,i see a message " Please select category to be able to upload files". Is it possible to have the category already selected and get rid of the alert message? I want to have one categorie per user. Any help is appreciated.

Re: User upload pre select category

Posted: 06 Jul 2019, 14:33
by JohnD
I got a solution, which is probably very 'hacky' and not update safe:
In the file: \administrator\components\com_phocadownload\libraries\phocadownload\category\category.php

i deleted the first select option of the dropdown:

/*$categories[] = JHTML::_('select.option', '0', '- '.JText::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY').' -');*/
$categories = [];

and wrote a function that returns the actual catid which you need to set in the \components\com_phocadownload\views\user\tmpl\default_files_bootstrap.php file in order to get rid of the alert message.

My idea was to have the user uploads seperated into different (category) folders. If there is a official way how to do this or if you know how write a proper overwrite of this component let me know.

Re: User upload pre select category

Posted: 06 Jul 2019, 23:04
by Jan
Hi, there is no other way for now. You should only be aware what happened when there is no category or when there is more than one category (one will be automatically selected which can be confused)

Jan