Drupal.

Default Drupal file attachment types

I have the following list of extensions that I usually permit in drupal attachments:

  txt pdf doc docx html csv xlsx xlsm sh json
  cer pem pub key
  png jpg jpeg gif
  mkv sfv avi mp3 mp4 webm mov
  zip tar gz

How to program Drupal Cron

From drupalsun.

Implementing Cron tasks in Drupal

Cron tasks are defined by implementing the hook_cron hook in your module, just like in previous Drupal versions.

/** 
 * Implements hook_cron(). 
**/ 
function example_cron() { 
  // Do something here. 
}

And that's pretty much it. Rebuild cache and next time cron runs your hook will be called and executed.

An example of a bug report and the technical conversation around it to resolve it

I recently had to justify the amount of effort that software development takes. Someone unfamiliar with the process thought that software development is easy, or that it doesnt take much time. They thought, for example, that an advanced reporting app can get pdf export capability if they just said to the development team, "implement pdf export." Literally, they thought that writing a single line of text like that in a specification document would result in the organization gaining that functionality. 

Drupal 9: How to make the /user/register form available in a twig template

Q: When comments in a (content type) Article are enabled, for an anonymous user Drupal 9.5 shows a text with links, "please regiter or login to post a comment". I would like the login form to be rendered there already, so that the user can login without leaving the article. For this, I would like to make the /user/register form available inside a twig template. How would I do that?

A: Install Twig Tweak (reference) and try this:

[FIXED] Uncaught PHP Exception EntityStorageException: Invalid address: (to): at SqlContentEntityStorage.php line 815

Seeing this ^ error and currently don't know how to fix it. It happens only on some of my (presumably identically configured) websites. This is happening when a user attempts to post any comment.

Turns out, this was due to a workflow rule that attempted to email the author of a parent-comment and notify them that their comment has been replied to. Since there is no parent comment, there is no email to send a message to, which was causing the error.