sudo chown -R MYUSER:www-data *
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 640 {} \;
sudo find sites/default/files/config* -type f -exec chmod 664 {} \;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Sometimes we need to submit only part of the form. Sure, if form has #required fields, all they will be highlighted with red, | |
| //and form will not be submitted if these elements have no value. | |
| //To workaround this, we can use '#limit_validation_errors' option AND custom submit function for every 'Partial Submit' button. | |
| //Interesting note: when we use '#limit_validation_errors', we will see ALL form fields in _validate function, | |
| //but in _submit function will be visible ONLY elements, included in '#limit_validation_errors' array!!! | |
| //Case 1. The most simple. | |
| //We want to make a 'reset' button, or 'previous step' button, so it must work even if some REQUIRED form elements are empty: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # Ubuntu 16.04 Dev Server | |
| # Run like - bash install_lamp.sh | |
| # Script should auto terminate on errors | |
| echo -e "\e[96m Adding PPA \e[39m" | |
| sudo add-apt-repository -y ppa:ondrej/apache2 |