Posts tagged with drupal

Sometimes when we update the drupal major version from 8.x to 9.x or even to 10.x, we will have problems with the modules, for example, there might be multiple installations of the single module, that is, you wil find the modules in two directories,

/modules/modulename
/modules/contrib/modulename

This is because the old module is installed manually and the contrib/ is installed by composer, to solve the problem, you have to do the following,

remove the /modules/modulename and run

vendor/bin/drush cr

to rebuild the cache registry, this will ensure the module is actually called from /modules/contrib/modulename.

Incase your module is not found in the /modules/contrib directory, you will need to run

composer require drupal/modulename

and then remove the module/modulename, run drush cr again.

When using Drupal 10.1 or above under Nginx+php-fpm, probably encounter 404 not found or too many redirects after enable CSS/JS aggregation.
This is actually caused by the nginx configuration, in your host config file, find the following line

location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}

and replace with

location @rewrite {
rewrite ^ /index.php;
}

Then reload your config file, the problem shall be solved.

Reference

https://www.drupal.org/project/drupal/issues/3368769