×

Error

Please login first

[SOLVED] CB Gallery uploads empty files

6 years 7 months ago - 6 years 7 months ago #297675 by crealiagroup
[SOLVED] CB Gallery uploads empty files was created by crealiagroup
I've tested with pdf and txt files (many different sizes) but I always got the same issue, the files are created but they are empty. The upload process goes well and the files are correctly shown in the Gallery Tab but they are not linked and also if I check in backend list they have 0KB.

I see that the error comes out when I, as Super Admin, upload a file into another user gallery. In this case I've got this issue meanwhile if I upload the files in my own tab they are correctly uploaded.

What's wrong?

Please Log in to join the conversation.

6 years 7 months ago #297681 by krileon
Replied by krileon on topic CB Gallery uploads empty files
Text and PDF files aren't opened or processed in any way so I've no idea. Works perfectly fine in all my tests as well. Ensure everything is up to date then retry. If issue persists check if you're using any of those security extensions like Akeeba AdminTools and try disabling them. If issue still persists check server error log after upload and see if something failed.


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.

Please Log in to join the conversation.

6 years 7 months ago #297682 by crealiagroup
Replied by crealiagroup on topic CB Gallery uploads empty files
I've found that the issue is related to an Auto Action that I've setted according to this topic: www.joomlapolis.com/forum/255-developer-members-support/237034-solved-cb-gallery-as-repository-for-single-users-only-admin-can-upload-manage

How to fix it?

Please Log in to join the conversation.

6 years 7 months ago #297685 by krileon
Replied by krileon on topic CB Gallery uploads empty files
Ok, the issue is the file path then. The path of a file is based off the owner. You'll need a more advanced auto action to modify the object by reference so the path generates properly. Below should work.

Global
Triggers: gallery_onBeforeCreateGalleryItem
Type: Code
User: User
Access: Everybody
Conditions
1: [var3_asset] Is REGEXP /^profile\.\d+/
Action
Method: PHP
Code:
$variables['var3']->set( 'user_id', '[user_id]' );
Parameters
Reference Variables: Variable 3

Note for the above to work please ensure CB Gallery is up to date.

This is technically a bug in CB Gallery though. Uploads should always be from the user making the upload instead of the user owning the gallery. Have added a bug ticket to investigate and fix in a later release.

forge.joomlapolis.com/issues/6799


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.

Please Log in to join the conversation.

6 years 7 months ago #297693 by crealiagroup
Replied by crealiagroup on topic CB Gallery uploads empty files
I've added this auto action to the first one and now it seems work fine.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.161 seconds

Facebook Twitter LinkedIn