NH, USA
Account created on 25 January 2007, over 18 years ago
#

Merge Requests

More

Recent comments

🇺🇸United States DamienMcKenna NH, USA

I recreated the example hook implementation for CKEditor Media Resize, which was my intended use case: Convert data migrated using Media Migration to new structure Active

🇺🇸United States DamienMcKenna NH, USA

This code has been working for me in local testing.

🇺🇸United States DamienMcKenna NH, USA

FYI I've tested it now using code from the example hook implementation in the API docs, and it's working rather well for me, especially when used with 💬 Recommendation for converting alignments added via "style" attribute Active .

🇺🇸United States DamienMcKenna NH, USA

A WIP and untested ;-) change to add hook_media_wysiwyg_filter_alter().

🇺🇸United States DamienMcKenna NH, USA

I worked out how to do this in the module, so here's a merge request that checks for float:left, float:center or float:right in the "style" attribute on the source object. And it works great in my local testing :-)

🇺🇸United States DamienMcKenna NH, USA

@steva1982: No problem. This has been a weird situation for sure - there was no grand announcement that they were getting rid of half of their meta tags, the change had existed for a few years before I came across it, so I do sympathize with your confusion. Thank you for raising the question, I'm sorry it took me a bit to remember the root issue, but I'm glad I could help. Take care.

🇺🇸United States DamienMcKenna NH, USA

Thanks for mentioning that issue.

🇺🇸United States DamienMcKenna NH, USA

Disclaimer: I'm using the address field via a Webform element, so I'm not discounting the possibility that there's a problem with Webform.

🇺🇸United States DamienMcKenna NH, USA

damienmckenna created an issue.

🇺🇸United States DamienMcKenna NH, USA

Giving folks here credit for working on this.

🇺🇸United States DamienMcKenna NH, USA

damienmckenna changed the visibility of the branch 3484792-page-manager to active.

🇺🇸United States DamienMcKenna NH, USA

damienmckenna changed the visibility of the branch 3484792-page-manager to hidden.

🇺🇸United States DamienMcKenna NH, USA

damienmckenna made their first commit to this issue’s fork.

🇺🇸United States DamienMcKenna NH, USA

This would happen because some of the logic uses empty() to check if the value is set, rather than checking to see if it's blank. So, if you look around for uses of empty() you'll probably find the source of the problem.

🇺🇸United States DamienMcKenna NH, USA

This would be a feature request.

🇺🇸United States DamienMcKenna NH, USA

Committed. Thank you.

🇺🇸United States DamienMcKenna NH, USA

Doing a little debugging on this, the problem is that the after maintenance mode is set and the render cache is invalidated, loading the user/1 page again results in the "Access denied" message instead of the "Site under maintenance" message.

So for some reason the output cache was not invalidated as expected.

🇺🇸United States DamienMcKenna NH, USA

The same code needs to be turned into a test.

🇺🇸United States DamienMcKenna NH, USA

Yes, let's do that.

🇺🇸United States DamienMcKenna NH, USA

The change needs to accommodate "empty" values that are not blank, i.e. the number zero.

🇺🇸United States DamienMcKenna NH, USA

Committed. Thank you all.

🇺🇸United States DamienMcKenna NH, USA

Won't this remove valid strings which fail empty(), like the number zero?

I think this should be changed to loop over each element of the array and run the old check.

🇺🇸United States DamienMcKenna NH, USA

damienmckenna changed the visibility of the branch 3396529-no-main-property to hidden.

🇺🇸United States DamienMcKenna NH, USA

Did you enable the Metatag Twitter Cards submodule?

🇺🇸United States DamienMcKenna NH, USA

Moving this to the 2.1.x branch.

Maybe there's a way of inheriting this from the parent class?

🇺🇸United States DamienMcKenna NH, USA

Some of the tests are failing against the 11.2.x branch, so I opened a separate issue to fix them: 🐛 Entity field tests are failing with 11.2 Active

🇺🇸United States DamienMcKenna NH, USA

Committed. Thank you.

🇺🇸United States DamienMcKenna NH, USA

Never mind, it already does.

Doing a little tidying on the code to match the coding standards.

🇺🇸United States DamienMcKenna NH, USA

I suspect there's a tag group plugin in your codebase somewhere that can't be loaded, maybe because it comes from a Metatag or Schema Metatag submodule that has been disabled despite being defined in configuration.

I think we need a log message to track the fact that $group_name wasn't loadable.

🇺🇸United States DamienMcKenna NH, USA

Thank you Claudiu!

🇺🇸United States DamienMcKenna NH, USA

IMHO a major part of this is the CSS that goes with the image, so in the examples in #23 there might be CSS that also affect how the image is being displayed.

🇺🇸United States DamienMcKenna NH, USA

BTW it's not technically possible to set the image's width and height attributes to the specific image variation the browser will use as the HTML tag is generated at the server, and the server doesn't know what the browser is going to do with it.

🇺🇸United States DamienMcKenna NH, USA

I wanted to know what the recommended solution was for the "width" and "height" attributes when using responsive images.

I couldn't find any recommendations on Mozilla's dev article on the topic or their <img> docs page.

I did find this article:

The article says "Set width and height to the resolution that corresponds to your default src." That suggests that Drupal core's handling of these attributes is correct and that we should close this as "won't fix".

🇺🇸United States DamienMcKenna NH, USA

It might make sense to extend dom_str_replace..

🇺🇸United States DamienMcKenna NH, USA

Could you please clarify what the HTML looks like before and after this change? I think that would help everyone understand what is happening. Thank you.

🇺🇸United States DamienMcKenna NH, USA

Oh bother! Thank you for spotting that and for providing a fix.

I guess we don't have much test coverage for that submodule, which is why the tests didn't flag it.

This will be included in the next 2.1.x release.

🇺🇸United States DamienMcKenna NH, USA

Is this the correct approach or are there other considerations or appraoches to fixing this that I didn't take into account?

🇺🇸United States DamienMcKenna NH, USA

This is the code I'm prototyping:

if ($this->moduleHandler->moduleExists('tvi')) {
  if (str_starts_with($display->getBaseId(), 'views_')) {
    $term = \Drupal::routeMatch()->getParameter('taxonomy_term');
    if ($term instanceof TermInterface) {
      $tvi = \Drupal::service('tvi.tvi_manager');
      $term_view = $tvi->getTaxonomyTermViewAndDisplayId($term);
      if (!empty($term_view) && isset($term_view['view_id'], $term_view['display_id'])) {
        $display_plugin_definition = $display->getPluginDefinition();
        if (isset($display_plugin_definition['view_id'], $display_plugin_definition['view_display'])) {
          if ($term_view['view_id'] == $display_plugin_definition['view_id'] && $term_view['display_id'] == $display_plugin_definition['view_display']) {
            return TRUE;
          }
        }
      }
    }
  }
}

It feels a bit unclean, besides the \Drupal::service() usage. Is there a better way?

🇺🇸United States DamienMcKenna NH, USA

A prototype that checks if the current path is managed using TVI, then compares the current facet's Search API display against TVI's display.

🇺🇸United States DamienMcKenna NH, USA

I think SearchApiDisplay::isRenderedInCurrentRequest() needs to be extended to check if the configured view is displayed on the current page.

🇺🇸United States DamienMcKenna NH, USA

I'm running into a similar issue where I'm using the "page" display via TVI and the facets aren't being displayed though the block plugin is supposed to show.

🇺🇸United States DamienMcKenna NH, USA

The problem appears to be this:

class ViewfieldFormatterDefault extends FormatterBase {
..
  public function viewElements(FieldItemListInterface $items, $langcode) {
..
        if (!empty($view->result) || $always_build_output) {

This doesn't have any logic to check if the exposed form is supposed to be displayed.

🇺🇸United States DamienMcKenna NH, USA

It works if I select the "Always build output" option..

🇺🇸United States DamienMcKenna NH, USA

For consideration:

diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php
index d16ef550651..b3a8e0e0d41 100644
--- a/core/lib/Drupal/Core/Url.php
+++ b/core/lib/Drupal/Core/Url.php
@@ -276,6 +276,11 @@ public static function fromUserInput($user_input, $options = []) {
    * @see \Drupal\Core\Url::fromUserInput()
    */
   public static function fromUri($uri, $options = []) {
+    // Special handling for <nolink>.
+    if ($uri == '<nolink>') {
+      return Url::fromRoute('<nolink>');
+    }
+
     // parse_url() incorrectly parses base:number/... as hostname:port/...
     // and not the scheme. Prevent that by prefixing the path with a slash.
     if (preg_match('/^base:\d/', $uri)) {
🇺🇸United States DamienMcKenna NH, USA

Thank you for reporting the bug and providing a merge request, hopefully some folk will be able to test this and work towards committing a fix.

As a reminder, please set the "Assigned" field to "Unassigned" after you're finished with your work - attribution/credit for issues is tracked separately. Thank you.

🇺🇸United States DamienMcKenna NH, USA

This breaks the taxonomy hierarchy display.

A structure like this:

- Term 1 (weight 0)
  - Term 1.1 (weight 0)
    - Term 1.1.1 (weight 0)
  - Term 1.2 (weight 1)
- Term 2 (weight 1)
- Term 3 (weight 2)
  - Term 3.1 (weight 0)

This turns into the following:

- Term 1 (weight 0)
- Term 1.1 (weight 0)
- Term 1.1.1 (weight 0)
- Term 3.1 (weight 0)
- Term 2 (weight 1)
- Term 1.2 (weight 1)
- Term 3 (weight 2)

(or worse)

🇺🇸United States DamienMcKenna NH, USA

FWIW wrapping the code in a try-catch block works around the issue, e.g:

    try {
      $installed_version = InstalledVersions::getPrettyVersion('drupal/search_api_solr');
    }
    catch (\Exception $e) {
      return self::SEARCH_API_SOLR_MIN_SCHEMA_VERSION;
    }
Production build 0.71.5 2024