If you need an extended and specific version of this topic, read this article:
*Functional testing for Browser in Drupal 8-9 using PHPUnit
- David Rodríguez, @davidjguru.
- Contact at davidjguru@gmail.com
- Website: https://therussianlullaby.com
If you need an extended and specific version of this topic, read this article:
*Functional testing for Browser in Drupal 8-9 using PHPUnit
$registry->addFieldResolver('ContentType', 'graphqlField',
$builder->compose(
$builder->produce('entity_id')
->map('entity', $builder->fromParent()),
$builder->callback(function ($id) {
// First: get node by id.
$node = \Drupal::entityTypeManager()->getStorage('node')->load($id);
// Second: get entity reference id.
$entity_id = $node->get('field_entity_reference_name')->first()->getValue()['target_id'];
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug", | |
"type": "php", | |
"request": "launch", | |
"hostname": "0.0.0.0", | |
"port": 9000, | |
"pathMappings": { |
I have gathered here all the articles about the imminent Drupal 8 EOL and how to deal with the upgrade to Drupal 9. This is the collection of my favourite reading material related to this case.
Well, I have a Content Type "basic page" (a classic) and inside I can use Layout Builder to put in some custom blocks with fields. For this case I need to reach values from a certain block "FactBox" and some of its fields: title, subtitle, body...you know. But I have to get values from an entity reference field too. I have a media field for uploading documents "listOfDocuments" (name of type: MediaPdf), and I need to send to the frontend layer name of the file, url, the internal uri... How can I get the values? this is the use case here.
As you can see, I'm trying to reach values from fields: uri, url, name
of a media entity MediaPdf
in a field ListOfDocuments
included on a block called MyCustomBlock
which is present in the main
zone of Layout Regions
inside a Content Type Page
and we're testing the query against a specific node with url /basic-page
. Along the way, I will take advantage and get other field values included in the custom blo
Module | D7 | D8 | D9 | Update | Use | Rating | Free | Link |
---|---|---|---|---|---|---|---|---|
Google Analytics | 👍 | 👍 | 👍 | 👉 | 💪 | 👌 | ✔️ | drupal.org/ga |
Google Analytics Reports | 👍 | 👍 | 👍 | 👉 | 🤘 | 👌 | ✔️ | drupal.org/gar |
Google Tag Manager | 👍 | 👍 | 👍 | ☝️ | 💪 | 👌 | ✔️ | drupal.org/gtm |
Piwik / Matomo | 👍 | 👍 | 👍 | ☝️ | 👊 | 👌 | ✔️ | drupal.org/m |
Matomo Reports | 👍 | 👍 | 👍 | ☝️ | 🙏 | 👌 | :heavy_check_ma |
In this snippet I've gathered some examples and cases about how to get taxonomy terms programmatically in Drupal, using always the same method and the same mechanics: get terms and then processing it in order to get only the required under certain criteria.
Well, maybe you need track some kind of information and data from Gitlab repositories and the Gitlab API (v4) seems to be very extensive and complex...ok, I understand you, really.
I had to connect a custom Drupal module to the Gitlab API in order to get some info, so I wrote down some notes with examples talkin' to the Gitlab API.
For the next examples, you only need to know your user id (no the @user, this is a keycode) and get an access token from your Gitlab profile settings. They are the basic resources requested by the Gitlab API for connections.
For more information, see the Gitlab API Resources documentation: https://docs.gitlab.com/ee/api/api_resources.html.
Author
I was developing an external query based in long/lat values in order to get certain addresses. For do this, I was using the geocoding library for PHP and some providers. I'm gathering here the main steps and how you can execute the integrations.
Maria Arias de Reyna, @delawen and Juan Luis Rodríguez, @juanluisrp guided me. They are the greatest GIS experts I know and they were very helpful here, givin' me some ideas and links to resources. Kudos.