Submitted by
Dmitro
on
ERROR ==> connect ENOENT /var/run/docker.sock ENOEN
Submitted by
Dmitro
on
To use colima socket
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
Editing hosts file on Mac
Submitted by
Dmitro
on
To edit hosts file on Mac M1 need to execute this command:
sudo nano /private/etc/hosts
Install optional config
Submitted by
Dmitro
on
// Install optional config.
$path_to_module = \Drupal::service('extension.path.resolver')->getPath('module', 'dev_tools');
$config_path = $path_to_module . '/config';
$config_source = new FileStorage($config_path);
\Drupal::service('config.installer')->installOptionalConfig($config_source);
Database fix collation
Submitted by
Dmitro
on
If on db import you get error "Unknown collation: 'utf8mb4_0900_ai_ci'"
sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' db.sql
Docker troubles
Submitted by
Dmitro
on
Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:443 -> 0.0.0.0:0: failed to connect to /var/run/com.docker.vmnetd.sock: is vmnetd running?: dial unix /var/run/com.docker.vmnetd.sock: connect: no such file or directory'
/Applications/Docker.app/Contents/MacOS/install remove-vmnetd
sudo /Applications/Docker.app/Contents/MacOS/install vmnetd
[Docker Desktop for Mac] ERROR ==> connect ENOENT /var/run/docker.sock
ddev usefull commands
Submitted by
Dmitro
on
To remove all DDEV containers, without creating db backups, also remove stored project data (MySQL, logs, etc.)
ddev remove -a -O -R
To execute database management with sequelace:
ddev sequelace
Call to undefined function get_magic_quotes_gpc()
Submitted by
Dmitro
on
Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_gpc()
This function has been DEPRECATED as of PHP 7.4.0 and REMOVED in 8.0.0.
Database query examples
Submitted by
Dmitro
on
Update the 'pair' field using an expression to concatenate the fields.
$database = \Drupal::service('database');
$database->update('mono_currency_rates')
->expression('pair', "CONCAT(currency_code_sell, '/', currency_code_buy)")
->isNull('pair')
->execute();
Sort:
Guide to Automate Custom Entity Creation Using Drupal Console
Submitted by
Dmitro
on
- Install Drupal Console: If you haven't installed Drupal Console yet, you can do so by following the instructions on the Drupal Console website. You can install it globally or locally in your project.
Generate the Custom Entity:
Use the following command to generate a custom entity: