Account created on 8 May 2007, over 17 years ago
#

Merge Requests

Recent comments

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I found that by setting the `Number of links in each sitemap page` to 5000 or less, my memory problems went away. This is accessible via the `/admin/config/search/xmlsitemap/settings` URL and is hidden under the `Advanced settings`

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Thanks! #6 worked for me too:

    $build = [];
    $points = [
      ['lat' => 37.7749, 'lon' => -122.4194, 'city' => 'San Francisco', 'job' => 'Software Engineer'],
      ['lat' => 34.0522, 'lon' => -118.2437, 'city' => 'Los Angeles', 'job' => 'Data Analyst'],
      ['lat' => 36.746841, 'lon' => -119.772591, 'city' => 'Fresno', 'job' => 'Web Developer'],
      ['lat' => 30.2672, 'lon' => -97.7431, 'city' => 'Austin', 'job' => 'Software Engineer'],
    ];

    // Convert points to features.
    $features = [];
    foreach ($points as $point) {
      $popupContent = $point['city'] . '<br>Lat: ' . $point['lat'] . '<br>Lon: ' . $point['lon'] . '<br>Job: ' . $point['job'];
      $features[] = [
        'type' => 'point',
        'lat' => $point['lat'],
        'lon' => $point['lon'],
        'popup' => [
          'value' => $popupContent,
          ],
      ];
    }

    // Create a map with the features.
    $map = leaflet_map_get_info('OSM Mapnik');
    $build['map'] = $this->leafletService->leafletRenderMap($map, $features, '500px');

    return $build;
  }
πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I'm seeing the same. Two header rows but at least the sticky works!

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I applied this MR and it worked fine for me. I didn't dig into any side effects this may have on Content Moderation. It does report that a field could not be cloned because the createDuplicate method does not exist. I suspect it isn't really an issue though.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I like the way the Drush documentation works in that the link to "latest" at https://www.drush.org/latest/ dynamically takes you to the latest version i.e. version 12 of the docs at https://www.drush.org/12.x/
This could be effective for overview pages where we could set up redirects to send folks to the latest and greatest

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I'm considering implementing this as I work on my plugin chapter of my book. I was thinking about doing a custom field type as they can have config.

One idea is to create a custom field type for a recipe content type that might have a quantity, unit of measure and ingredient name. It could be potentially be smart enough to use a taxonomy for the unit of measure.Maybe a simpler option would make more sense. Anyone suggestions?

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

@maskedjellybean, Maybe this would be helpful: https://selwynpolit.github.io/d9book/dtt

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

@alexharries, did you try installing Drupal dev tools in your project with `composer require drupal/core-dev` ?

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

One of the struggles I had when creating my book - Drupal at your fingertips was to identify the audience. I've seen documentation that tries to be suitable for new users vs experienced users. That is a very tall order. We have the challenge of having so many different identities:

  • content editors
  • site builders
  • curious visitors
  • hobbyist developers & tinkerers
  • pro developers
  • front-end developers
  • back-end developers
  • full stack developers
  • business folks?
  • others?

This may require that there be different versions of the docs. I tried to focus on pro developers but sprinkled in "the basics" sections in some spots. Not sure if that was the best way to go...

If this is helpful to the initiative, I am using markdown and a theme called Vitepress and folks can submit PR's via github to update the book. Please feel free to check that out.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I'm hosted on greengeeks.net and I discovered that the issue is definitely that I had to uncheck the `pdo_mysql` setting in CPanel under `current PHP version` and check the `nd_pdo_mysql`

It wasn't clear to me initially that the `pdo_mysql` needed to be disabled first.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I came up with this function which I thought might be useful for folks:

  /**
   * Returns the human-readable value of a list field in an entity
   *
   * This function accepts an entity, the field name (which is assumed to be a list field),
   * and a value from that list field. It then returns the human-readable label associated
   * with that value in the list field's allowed values.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity that contains the field.
   * @param string $field_name
   *   The machine name of the list field on the entity.
   * @param string $list_item_value
   *   The value in the list for which to get the label.
   *
   * @return string
   *   The human-readable label for the list value, or an empty string if not found.
   */
  public static function getListFieldHumanReadableValue(EntityInterface $entity, string $field_name, string $list_item_value): string {
    // E.g. 'node.article.field_foo'.
    $allowed_values = $entity->$field_name->getSetting('allowed_values');
    $human_readable_value = $allowed_values[$list_item_value];
    return $human_readable_value;
  }

More details in my book at Drupal at your Fingertips: Get the human readable value from a list field

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Add instructions to install the new composer lenient plugin

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I downgraded drush to version 11 for now and permitted me to run the drush commands I needed for my d9-d10 upgrade.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I couldn't get this patch to apply so I rolled a local version and stuck it in a file.

Here are the contents of the file in case it helps someone:

diff --git docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.info.yml docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.info.yml
index 1a0e13eec..f322ff847 100644
--- docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.info.yml
+++ docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.info.yml
@@ -1,7 +1,7 @@
 name: 'Node Access Rebuild Progressive'
 description: 'Rebuild node access grants in chunks'
 type: module
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^9.4 || ^10
 
 # Information added by Drupal.org packaging script on 2020-06-23
 version: '2.0.0'
diff --git docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.module docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.module
index 45f7c8a41..d2fc50637 100644
--- docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.module
+++ docroot/modules/contrib/node_access_rebuild_progressive/node_access_rebuild_progressive.module
@@ -36,7 +36,7 @@ function node_access_rebuild_progressive_trigger() {
   node_access_needs_rebuild(FALSE);
   // Add default grants in the unlikely case
   // no modules implement node_grants anymore.
-  if (!count(\Drupal::moduleHandler()->getImplementations('node_grants'))) {
+  if (!count(\Drupal::moduleHandler()->hasImplementations('node_grants'))) {
     node_access_rebuild_progressive_set_default();
     return node_access_rebuild_progressive_finished();
   }

I added it as node_access_rebuild_progressive_d10.patch in my patches folder

Here are the relevant lines in composer.json:

        "patches": {
            "drupal/node_access_rebuild_progressive": {
                "Automated Drupal 10 compatibility fixes - 3288770": "patches/node_access_rebuild_progressive_d10.patch"
            }
πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Perhaps a feature request might be in order to display a message to the user that they need to pay OpenAI (rather than an ajax error)

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

And it appears that the answer was to give OpenAI some money. That fixed it. Hopefully this saves someone else some time. Closing this ticket.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

I'm seeing an AJAX error on my fresh Drupal site running with DDEV any time I try to use the OpenAI Prompt Explorer and click the "Ask OpenAI" button.

I would love to know what kind of configuration error caused this. I have put an API key in as well as an Org ID. I have updated the config.yaml file to have:

webserver_type: apache-fpm

I've also added the file .ddev/apache/apache-streaming.conf with these contents.

# Per OpenAI README.md
<IfModule proxy_fcgi_module>
    <Proxy "fcgi://localhost/" enablereuse=on flushpackets=on max=10>
    </Proxy>
</IfModule>

Suggestions welcome. I'd really like to try out all the new AI magic this module has to offer.

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Just to elaborate on #42. I found that by editing the .idea/php.xml file, even while PHPStorm is open, and removing the line:

    <option name="installedPaths" value="$PROJECT_DIR$/vendor/drupal/coder/coder_sniffer" />

from the section displayed below, the error immediately went away.

  <component name="PHPCodeSnifferOptionsConfiguration">
    <option name="codingStandard" value="Drupal" />
    <option name="highlightLevel" value="WARNING" />
    <option name="installedPaths" value="$PROJECT_DIR$/vendor/drupal/coder/coder_sniffer" />
    <option name="useInstalledPaths" value="true" />
    <option name="transferred" value="true" />
  </component>
πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Maybe I am missing something but I was not able to make the expiration time change using #25. I haven't tried the patch yet, but that seems like a good way to go.

Production build 0.71.5 2024