⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

impressions of a beginner in Grocery CRUD Enterprise



luiz.want@gmail.com

luiz.want@gmail.com
  • profile picture
  • Member

Posted 22 April 2019 - 17:55 PM

Hello,  
 
I'm Luiz Eduardo, I bought the enterprise version recently and I'm having some dificults, I believe that you guys can help me:
 
  1. I had a well done code from a free version GC, now I'm converting this controllers to the enterprise version. I have a table with 120.000 registers and the loading of this crud is very slow, I had similar problems with free version when I was using datagrid theme, but now I don't know how to solve this in enterprise version. What were my mistaken?
  2. My system deal with .xml and .zip files, in free version I changed the grocery_crud_file_upload_allow_file_types in config/grocery-crud.php, where can I do this on enterprise version?

 


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 25 April 2019 - 04:18 AM

Hello Luiz, for the grocery_crud_file_upload_allow_file_types it is something that I've missed adding it at Grocery CRUD Enterprise. I will try to add it at the next version (I will inform you once this is ready).

Till then you can change the hardcoded value from:
 

application/libraries/GroceryCrudEnterprise/grocerycrud/enterprise/src/GroceryCrud/Core/State/StateAbstract.php

 

at around line 360 you will find some code that will look like this:

 

   // Validate file upload
        $file->addValidations(array(
            new \Upload\Validation\Extension([
                'gif', 'jpeg', 'jpg', 'png', 'svg', 'tiff', 'doc', 'docx',  'rtf', 'txt', 'odt', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'pps', 'ppsx', 'mp3', 'm4a', 'ogg', 'wav', 'mp4', 'm4v', 'mov', 'wmv', 'flv', 'avi', 'mpg', 'ogv', '3gp', '3g2'
            ]),

            // Ensure file is no larger than 20M (use "B", "K", M", or "G")
            new \Upload\Validation\Size($maxUploadSize)
        ));

there you can add your extra filetypes. For example in your case you will do something like this:

 

new \Upload\Validation\Extension([
                'zip', 'xml', 'gif', 'jpeg', 'jpg', 'png', 'svg', 'tiff', 'doc', 'docx',  'rtf', 'txt', 'odt', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'pps', 'ppsx', 'mp3', 'm4a', 'ogg', 'wav', 'mp4', 'm4v', 'mov', 'wmv', 'flv', 'avi', 'mpg', 'ogv', '3gp', '3g2'
            ]),

Now for the slow table, that's really weird! Can you please send me a PM at: info@grocerycrud.com with your specific case to see if I can help you?

Regards

Johnny