Recently I started using history command a lot. Just to check what I have done. One thing missing by default is timestamp, I want to know when I did something so to do that you can do this
Recently I started using history command a lot. Just to check what I have done. One thing missing by default is timestamp, I want to know when I did something so to do that you can do this
Having problems with importing and exporting configurations on drupal 8 and (probably language) config files appearing out of nowhere, this might be due to git and permission problem. To solve that just do this
git config core.fileMode false
or even globally
Not many devs use try catch in custom code, especially in drupal 7. Thing is that it can save you from bigger problems if you wrap your (bad) code into that block, so lets just make simple example how to use it.
With docker4drupal its easy to enable solr whith docker-compose, its is also easy to do that with other drupal docker bundles. But to make this work it needs some manual work as well. First you need to make sure solr runs properly, test it, see that url to it shows it runs.
If you get error when dumping DB with drush CLI that says something like this
When you try to git stash and get some error like "error: unable to unlink old" with permission denied with it, it is at is says permission problem, but not on that file, but directory where that file is. So go to that folder where the problematic file is (usually it will be default folder) and give that folder permissions to write for user and group.
On big projects composer downloads take time, to make that faster there is a plugin called prestissimo
https://github.com/hirak/prestissimo
that will give you parallel installs of libraries. Per their statement they claim this benchmark example
288s -> 26s
If you have big sprint with big amount of task and put all of that into feature branch that you need to deploy (merge to master) then it is good to have one big final checkup before doing that. So what I do is this, go to your master branch and either make one temp branch from it like "master_temp" or do it directly there. For extra caution I use temp branch.
If you are using file_scan_directory to scan files in some directory and then loop over them to use them for some action, you probably also want to sort them, otherwise you will get them in order that is set in filesystem. So to do that, you need to set key in options to "filename" to use filename as key, so you can sort that associative array per key.
To flush some image style, you can install module for that with UI, but you can also do it in lean way, with just drush php command or if locally with devel/php window. If using drush use this command
drush php-eval '$style = image_style_load("optimize_original"); image_style_flush($style);'