CB Gallery : File Extensions doesn't appear to work in user tab

7 years 3 months ago - 7 years 3 months ago #290117 by benseve
Hello,

The "file extension" field in the "CB Gallery FILE" tab does not work, you have to correct it directly in the file:


/www/components/com_comprofiler/plugin/libraries/CB/Plugin/Gallery/CBGallery.php


Original line:

$gallery->get( 'files_extensions', 'zip,rar,doc,pdf,txt,xls' );

Line corrected:

if ( $gallery ) {
$extensions = $gallery->get( 'files_extensions', 'zip,rar,doc,pdf,txt,xls,docx,xlsx,odt,ods' );
} else {
$extensions = $params->get( 'files_extensions', 'zip,rar,doc,pdf,txt,xls,docx,xlsx,odt,ods' );
}

Can you please fix this bug?

thank you very much for your attention

Regards,

Please Log in to join the conversation.

7 years 3 months ago - 7 years 3 months ago #290124 by krileon
That's not bugged. It's intended to be as follows and is as such in latest build.

		if ( $gallery ) {
			$extensions				=	$gallery->get( 'files_extensions', 'zip,rar,doc,pdf,txt,xls' );
		} else {
			$extensions				=	$params->get( 'files_extensions', 'zip,rar,doc,pdf,txt,xls' );
		}

If the gallery object isn't provided it fail safes and falls back to global parameters. This allows per gallery override of that parameter. Globally it's configured in CB Gallery > Parameters > Files > Validation > File Extensions. Specifically for the profile gallery tab this is configured within CB > Tab Management > Gallery > Parameters > Files > Validation > File Extensions. It can even be menu by menu specific. Note gallery parameters are cached and you must revisit the original gallery output (e.g. go back to profile gallery) or relog for parameter changes to take affect.

It's likely there's some usages that are not passing $gallery to the function resulting in per gallery usage not working as expected. Aside from that my guess is you may have adjusted the wrong parameter.

Edit: I found no locations in source where $gallery was missing for that usage for files time. Please be sure you refreshed the gallery cache after changing that parameter by refreshing your profile page or relogging so the parameter takes affect.

Edit: Have adjusted the topic title to be less dramatic and more descriptive.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.180 seconds

Facebook Twitter LinkedIn