 Okay, thank you for coming everyone I know there was quite stiff competition between on the slots So thanks for coming on my session if you're the one would like like to download the slides. They are available on Google's today Google slides My remote doesn't work Okay, topic of this presentation will be right custom code or use a country module and as a question Very important for beginner Drupal developers, and I'm a Rafa Wenda. I'm working DC agency I'm a software engineer. You can find me on Twitter DDO I Think this is good enough Okay Why this question is important? Because every project starts with three every project Have some constraint like the price If we be we will be able to answer this question We can we can do a project which is cheap, which is good and which is fast and season Drupal module First we need to know what the requirements are. So first one is Asking question to our clients as many as possible. So any doubts can be solved We should be excited when a non-starting requirement will come out because it's a new feature something that we can create And acceptance criteria is a good start will tell us a lot about about the functionality which client needs and We can have few Solutions for that. The first one is using country country module The second one is in country module with patch or Using a patch or patching a country module that is leaking a functionality that we need Or create a custom module So we can make this decision by a following flow chart. So first we need to search for a Contrib module if it's exist If it doesn't exist, then we just write a custom module very simple If it exists, then we evaluate this module we check what kind of functionality it has if it's solved our needs if It has everything that we need then we just use it If not, then we need to check if any patch or any sub module exists so we can fulfill this requirement If the patch exists then we just use it if the patch doesn't exist then we need to Estimate how much affordable we will need to to implement this functionality if if it's a complex change then if it's not a complex change then we just Create a patch for this module It's a complex complex change if you're changing like 80% of that module then it's just faster to create our own module and When we use a country module it's something sometimes can be much more than we need and functionality that is provided with module can be sometimes complex to edit and use but code is not the only thing that is Important there's also committee committee that supports that module and There are a few advantages of using Committee solutions first one is security if we have more users then It's a free QA. So we can explain that to find out you have a quick free QA. So that's good thing flexibility if a module is contributed then probably it has much more than we need or Just a lot and the maintenance maintenance Someone else's writing and fixing bugs for us but they're also in this one that disadvantageous like module could include out of General functionality that we don't need and just a bigger code base with a lot of hooks and those hooks are executed I would cheat with each request and It might not play well with other modules that we are using on site It also could be difficult to change the default behavior or the UI So if you know now what kind of disadvantages the module has we can start to search for the right one Drupal.org there are more than 30,000 of modules and I personally started using a Google custom search to find one and You also can ask on your sir your see for that module So how Google custom search works? So you have a specific Text field on the bottom and you can provide your own I personally use Drupal module engine name and I'm using a module keyword as a keyword for a search and The S sign is a specific placeholder which will be used as a search search query and Then if I type module and press tablet tabulator, then This search engine is other than the front and I can search for a loose form Then I can see Results here So it's really it's really nice to wait to search for modules. I Prefer this one on the Drupal org search because it's just Google and it's more accurate and if I find that module Then I'm then then I need to review the profile page first. I start with the image Because image can tell me more than even the best description Then I am going to the description. I read what kind of functionality this module have Then I'm checking project information status of development in my tense And also how many times it was installed and don't add it Next I'm going to Reases and checking If this module has a stable release and when it was updated the last time Next one. I'm checking how What was the last time when maintainer was committing to that module? And I'm checking the issue queue So if there are many bugs that are closed that are open Then it's a bad sign if there are many bugs and many issues and it's a good sign because It means that the committee is using this module and they are behind it and The next thing is statistics. I am I can easily check if the maintenance responding to the issues and it's closing it's closing them if I Find this module is doing what I need then I need to test it Good way to test the modules are simple test me some website where you can just type the project name and It's installing Drupal instance for you Another option is drash quick insta. It's using SQLite and with one command you can insta Drupal and add a module to that stack Then you have to discover what's offered out of the box, so we're just testing the module trying to configure it and How it meets yours? How it meet your needs? After you're done you review the code If it follows Drupal standards Then you check if it's extendable with APIs and hooks Then you try to understand how functionality of that module works and You check if there is a gap between your country module That's module and your requirements If there is no gap then you can use this module But if there is no gap then Then you have a problem and You kind of feel disappointed But don't give up just yet Because there are things that you can still do you can discover missing functionality Starting to explain what this module not do And checking how much it's missing it's 20% or 80% The bigger the gap will be then to take you more time to feel it So you need to check for committee solutions The issue queue is good place to start to search for a purchase there you can also search for in Google like for a keyword like Drupal module and functionality you can close the gaps with committee help and Estimate the report how complex are the changes if there is if there is there isn't any committee solution How confident is an ability to make the changes? Are you? Or if there is enough time to make those changes So first we need to talk to the clients, but don't be afraid So if you talk to the client in to ask him Tell him how much time will take Those those changes So he need to be informed if it's a big change or small Then I need to tell him that fighting with Drupal is not always a good idea because Drupal has Some limitations and you need to tell a client what kind of in limitation it has And you after you tell him that maybe he will change his mind and you'll use just country modules with and without any changes to it But if the client doesn't want Go with the country then you can create a patch And to create a patch, you just create an issue on Drupal.org You always create a patch on against the dev version not stable one How to create a patch can be found under this URL And then you just add the patch file the issue queue and wait for the review from the maintainer After its merged you get you get credits for that But if it's a big change Then you create a custom module And creating custom modules is a good way to contribute Because don't contribute By contributing you are becoming a rockstar And few words about writing custom modules We need to keep in mind who take care of that functionality after you If it's a safe builder then probably it's not a good idea to create a custom module But if it's a group of Developers then you can be confident that they can handle it You need to consider a possibility to contribute back this module if it's a new functionality And you need to keep in mind that Drupal API is robust so you can easily create complex stuff with this API And your imagination is the only invitation But you need to remember that it can go much further than you want to So So don't try to imagine too much Because it can go out of the borders And when you decided to write a custom code Check Drupal developing developing modules side Which will tell you how to do that in the best way Then remember to follow Drupal coding standards And to make use of Drupal hooks and APIs Then of course test your code and if it's possible create automated tests with simple test And if you've done all of that your module will be perfect So if you decided to contribute that module be kind of personally sure that it's useful for others Name it appropriately So if you create a sub module for workbench then name it workbench something Fill the project page using a template provided provided on Drupal.org And then be an active maintainer I personally recommend this article from this how to be a responsible maintainer And then just to recap how to do it Search the module if you find it Then continue if not Build a custom module And evaluate if it has all functionality that you need Then use it it has If it doesn't have all functionality then Try to search for a committee patch or committee some modules If it has a patch then use it it doesn't then Check how big the change could be it's a big change It's small change then Create a patch and contribute from contributed back to the committee It's a big change then create a custom module because That's already much are you doing And and the questions now Yes Makes it complicated But that's the default way to install a module with a graph Using get it will make it a get sub module And then it seems likely I can override the heads of Meeting it up to the second to make it repository just for that module If you make any of your own changes to or you fuck out or something like that But uh, does it have the best set To a module inside your main project repository instead of a sub module or Would you like to Um, I'm not sure if I understand the question you're asking about Donating modules with drush Well now asking about when you maintain modules whether you would always have a separate get the repository free from module Um for if that's okay to You talk to combine it into about the wider projects as one get the repository and not use the sub module I think it depends on the project if that module is Uh If depends on the functionality If the sub module is totally Can work totally Achieve different functionality then makes sense to Use different repository, but if all that sub modules Can combine it into our Integral stack then it makes sense to use the same repo Any more questions Yes Yeah, you can do that when you are relating when you check in the code and Genart when you're doing general tests of this module Then you can do also performance tests Any more questions? So thank you. That's all I had Prepared for today and see you in the pub