Adding Solr config zip to your remote server
Adding Solr config zip (ie. solr_8.x_config.zip) to your remote server. In this instance I'll be adding Solr config to a AWS EC2 server.
Log in to your remote server, then as you need to work as root type:
sudo su
Go to your solr directory:
cd /var/solr/
If you don't know the location of your solr directory run:
Formatting how date/time is displayed in Drupal 8/9
You can create a new date/time format by navigating to:
Admin -> Configuration -> Regional and Language -> Date and Time format and click on 'Add Format'.
Once you’ve created date format, you can control the way date is displayed on the node using preprocess function.
In {theme_name}.theme file, add the following lines
How merge a View exposed form with pager?
To assist in finding possible solutions some of the queries that I made include:
- Drupal 9 pager with items_per_page
- Drupal 9 pager merged with exposed form items_per_page
How do I get a page’s current URL in Twig for Drupal 9
Having access to a site’s URL in your templates can come in handy for many different use cases, such as determining if your on the admin/people page as apposed to admin/reports/dblog or admin/content. These three pages might seem to bear on common relationship, however there is at least one. Users.
I edited the user in the admin/people page so rather than showing just username, know shows:
How to zip a file using command (cmd) line?
This short guide explains to you how to extract/unzip .zip archive files to a specific or different directory in Linux.
Install zip
sudo apt-get install zip
Zip a directory
Zip your folder:
zip -r {filename.zip} {directory}
Unzip
unzip {filename.zip}
Drupal - how to increase the maximum file upload size?
By default the maximum file upload size is set to 2MB. It is not a Drupal issue, instead a php issue as upload_max_filesize is set in your php configuration (php.ini file). Therefore it is a server-side configuration.
Drupal watchdog
Creating a message log using Drupal watchdog.
Simple log
// Logs a notice
\Drupal::logger('my_module')->notice($message);
// Logs an error
\Drupal::logger('my_module')->error($message);
Adding a layer of complexity to the log
public function submitForm(array &$form, FormStateInterface $form_state) {
$entity = $this->getEntity();
$entity->delete();
Drupal instance of Drupal \ path_alias \ AliasManager given
I'm receiving an error with a path of Drupal\path_alias\AliasManager
Upgrading to Drupal 9, I was running a test to see which blocks and/or modules would fail. And there were plenty... like this AliasManager error
Acy Mailing 5 sending a newsletter
In this article, you will learn how to send a newsletter using Acy Mailing 5.
Access to Acy Mailing 5
This is screen accessible via the administration area: Select Components → Acy Mailing 5 → Newsletters from the drop-down menus.
Acy Mailing 5 managing a newsletter statistics
In this article, I'll show you how to review a newsletter's statistics for newsletters sent with Acy Mailing 5.