developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
144
results
Andrew Fletcher
•
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::logger('content_entity_example')->notice('@type: deleted...
Andrew Fletcher
•
Working in Twig, I had to add classes to a pre-existing array. Whilst I've...
Andrew Fletcher
•
On a git pull from remote dev environment to a staging environment running off...
Andrew Fletcher
•
I was trying to create something quite simple. How to get image file uri...
Andrew Fletcher
•
Setting up a new project in Docker and VS Code.
Using Terminal, go to your...
Andrew Fletcher
•
Load testing verifies the system performance under the expected peak load. The peak load needs to set by a series of parameters that you have benchmarked targets. For example, these parameters could include:
Load testing:
20,000 concurrent users; and
response time of under 4 seconds
Stress testing:
Verifies the server performance under extreme load. Test this through examining how many users are required to bring your server
Endurance testing:
Load test over an extended...
Andrew Fletcher
•
A bug bear that I have had for a while with Drupal content is how come the...
Andrew Fletcher
•
Time is essential to all of us... and if you are like me there is never enough...
Andrew Fletcher
•
Updating Drupal from 8.7.10 to 8.8.x or 8.9.x has seen a significant change...
Andrew Fletcher
•
As outlined in an earlier article composer php version, when installing the...
Andrew Fletcher
•
Blocks are a great way to add pieces or chunks of content to your Drupal site. Capable of displaying simple text, images, forms or complex logic. There are plenty of sites around that show you how to add a simple custom block. However, if you are a developer like me, when you are writing your custom block programmatically it has far more requirements than a simple block. In this article, I'll show how to:
Create your initial custom block;
Adding a...
Andrew Fletcher
•
Adding an image via RESTUI can be done in a snap... once you know how! I...
Andrew Fletcher
•
When you are in the status report of the admin area are you finding the...
Andrew Fletcher
•
The magically descriptive error 401 Forbidden "message": "Access...
Andrew Fletcher
•
Loading the node
To query the node, I prefer to create a series of functions to...