The module development and code questions forum is intended to aid those who are developing modules or writing code for Drupal.
Please note that this forum is also not intended for "Is there a module that does..." or "I need help with module x..." questions. It's also not a place to ask developers to write your code for you. Please respect this.
Please do not post general discussions intended to target module developers. If the question you have isn't specifically related to writing a drupal module, please post it in a more appropriate forum.
If you you have drupal installed already and are seeking a module that does a specific task, have a question about a specific module and what it does or if it will fit your use case, please place your questions in the Post installation forum.
If you have a problem or question about a specific module, you should create an issue in the module's issue queue (after checking for an existing issue first).
If you don't have drupal installed yet, please place your questions in the Before you start forum.
I work with my own entities created in code with hook_entity_info(). I have a base class, that inherits from Entity, common with all my entities. I also want that the user entity inherits from my base class.
I recently started developing in Drupal 7, I'm coming from ZendFramework 2, so in ZF2 i usually use a lot of small modules with a very specific functionality, because unless you put everything in your bootstrap of the modules, my modules usually ticks in, in less than 0.01ms. Then i use one module that is in a simple way just loading the modules needed for that one instance into child modules and then displays them.
So my question is on Drupal, should i build a lot of small modules or one big? please give me a bit of explanation why you think yes or no.
I have this custom form which allows user to upload files. managed_file field is used for this purpose. Now I want to validate the uploaded file content (eg. check virus) after user submit the form. How do I clear the file field that it only display an empty file upload widget in the form after the validation fails?