Account created on 19 October 2016, about 8 years ago
#

Merge Requests

Recent comments

πŸ‡ΊπŸ‡ΈUnited States andysipple

#17 was no longer applying for me.
Reroll #17

πŸ‡ΊπŸ‡ΈUnited States andysipple

First time using this module. Ran into the same issue. Just needed to clear the cache for TB Mega Menu block to be picked up.

πŸ‡ΊπŸ‡ΈUnited States andysipple

I can confirm the latest MR Template suggestions for custom block view modes ✨ Template suggestions for custom block view modes Fixed gives the correct twig template suggestions now.
Using block_field to reference a block_content get the following for a block type text

<!-- FILE NAME SUGGESTIONS:
   * block--whatisthemiseswire.html.twig
   * block--block-content--[block_content_unique_id].html.twig
   * block--block-content--id-view--[title_of_block_content]--full.html.twig
   * block--block-content--id--[title_of_block_content].html.twig
   * block--block-content--view-type--text--full.html.twig
   x block--block-content--type--text.html.twig
   * block--block-content--view--full.html.twig
   * block--block-content.html.twig
   * block.html.twig
-->

Get the following for the same block_content but used in block layout bundle

<!-- FILE NAME SUGGESTIONS:
   * block--block-content--[block_region].html.twig
   * block--sidebar-second--mises-[title_of_block_content].html.twig
   * block--sidebar-second.html.twig
   x block--bundle--text.html.twig
   * block--mises-[title_of_block_content].html.twig
   * block--block-content--[block_content_unique_id].html.twig
   * block--block-content--id-view--mises-[title_of_block_content]--full.html.twig
   * block--block-content--id--mises-[title_of_block_content].html.twig
   * block--block-content--view-type--text--full.html.twig
   * block--block-content--type--text.html.twig
   * block--block-content--view--full.html.twig
   * block--block-content.html.twig
   * block.html.twig
-->
πŸ‡ΊπŸ‡ΈUnited States andysipple

Confirming patch in comment #8 πŸ› Required crop types not being recognized Needs work works in Drupal 10.2.4 Image widget crop version 2.4

πŸ‡ΊπŸ‡ΈUnited States andysipple

@heddn, could you provide an example?

@catch, I agree with the suggested naming.

For further details on the loading="lazy" attribute and the threshold, refer to this link: https://web.dev/articles/browser-level-image-lazy-loading#improved_data-.... On a 4G connection, the threshold is set at 1250px, while on 3G, it's 2500px. Anything within this threshold is loaded according to Google documentation.
Unfortunately, I haven't found documentation explaining why adding loading="lazy" onto iframes does not yield better lighthouse scores.

πŸ‡ΊπŸ‡ΈUnited States andysipple

@catch added some screenshots. Yes, my mistake it should say "increase" not "decrease".

πŸ‡ΊπŸ‡ΈUnited States andysipple

This is re-roll patch so it works with 10.1.x.
Version 10.2.x adds drupal.media-icon: to media.libraries.yml found here https://git.drupalcode.org/project/drupal/-/blob/10.2.x/core/modules/med...

πŸ‡ΊπŸ‡ΈUnited States andysipple

AndySipple β†’ changed the visibility of the branch 3405593-add-intersection-observer to hidden.

πŸ‡ΊπŸ‡ΈUnited States andysipple

AndySipple β†’ changed the visibility of the branch 3405593- to hidden.

πŸ‡ΊπŸ‡ΈUnited States andysipple

AndySipple β†’ changed the visibility of the branch 3405593-add-intersection-observer to active.

πŸ‡ΊπŸ‡ΈUnited States andysipple

AndySipple β†’ changed the visibility of the branch 11.x to hidden.

πŸ‡ΊπŸ‡ΈUnited States andysipple

AndySipple β†’ changed the visibility of the branch 3405593-add-intersection-observer to hidden.

πŸ‡ΊπŸ‡ΈUnited States andysipple

Pseudocode Proposal:

  • Perform a login action.
  • Create a node in English with the title "Test Node (English) - Math.Random."
  • Validate the creation of the English node by comparing the titles.
  • Create a Spanish translation of the English node with the title "Test Node (Spanish) - Math.Random."
  • Validate the existence of the Spanish version of the node by comparing the titles.
πŸ‡ΊπŸ‡ΈUnited States andysipple

Getting the following error when trying to config import into a D10 site. Patch #18 is not working for me.

+------------+------------------------------+-----------+
| Collection | Config                       | Operation |
+------------+------------------------------+-----------+
|            | view_mode_page.pattern.print | Create    |
+------------+------------------------------+-----------+

 Import the listed configuration changes? (yes/no) [yes]:
 > yes

 [notice] Synchronized configuration: create view_mode_page.pattern.print.
 [notice] Finalizing configuration synchronization.

In ConfigImportCommands.php line 324:
                                                                                                                                                             
  The import failed due to the following reasons:                                                                                                            
  Unexpected error during import with operation create for view_mode_page.pattern.print: The &quot;node_type&quot; plugin does not exist. Valid plugin IDs   
  for Drupal\Core\Condition\ConditionManager are: config_pages_values_access, gtag_domain, gtag_language, language, current_theme, request_path, user_role,  
   webform, entity_bundle:block_content, entity_bundle:config_pages, entity_bundle:crop, entity_bundle:entity_subqueue, entity_bundle:feeds_feed, entity_bu  
  ndle:media, entity_bundle:menu_link_content, entity_bundle:node, entity_bundle:redirect, entity_bundle:taxonomy_term, entity_bundle:webform_submission, e  
  ntity_bundle:paragraph 
πŸ‡ΊπŸ‡ΈUnited States andysipple

patch applies cleanly with dev release only

πŸ‡ΊπŸ‡ΈUnited States andysipple

I was directed to this issue from https://www.drupal.org/project/pathauto/issues/3254939 πŸ’¬ Route "entity.path_alias.collection" does not exist Fixed

Symfony\Component\Routing\Exception\RouteNotFoundException: An exception of type 'Symfony\Component\Routing\Exception\RouteNotFoundException' with the message 'Route "entity.path_alias.collection" does not exist.' was noticed in /code/web/core/lib/Drupal/Core/Routing/RouteProvider.php on line 206
in Drupal\Core\Routing\RouteProvider::getRouteByName called at /code/web/core/lib/Drupal/Core/Routing/UrlGenerator.php (line 432)
in Drupal\Core\Routing\UrlGenerator::getRoute called at /code/web/core/lib/Drupal/Core/Routing/UrlGenerator.php (line 129)

We've been grappling with this error for some time now. It would trigger the White Screen of Death (WSOD) after deploying changes to the Pantheon live site using Redis or when clearing the cache. Although it seems random, this error occurs most consistently in our high-traffic live site.

We applied the patch mentioned in #27 πŸ› ModuleHandler skips all hook implementations when invoked before the module files have been loaded Needs work .

πŸ‡ΊπŸ‡ΈUnited States andysipple

We also got this error on a recent build.
Symfony\Component\Routing\Exception\RouteNotFoundException: Noticed exception 'Symfony\Component\Routing\Exception\RouteNotFoundException' with message 'Route "entity.path_alias.collection" does not exist.' in /code/web/core/lib/Drupal/Core/Routing/RouteProvider.php:206
in Drupal\Core\Routing\RouteProvider::getRouteByName called at /code/web/core/lib/Drupal/Core/Routing/UrlGenerator.php (432)
in Drupal\Core\Routing\UrlGenerator::getRoute called at /code/web/core/lib/Drupal/Core/Routing/UrlGenerator.php (129)

Adding patch #27 πŸ› ModuleHandler skips all hook implementations when invoked before the module files have been loaded Needs work
Thank you @andriy-parkhomiuk for pointing me to the core issue.

πŸ‡ΊπŸ‡ΈUnited States andysipple

Here is a patch

πŸ‡ΊπŸ‡ΈUnited States andysipple

Re-roll patch #13 πŸ› Facets searches don't update results RTBC
It was not applying to v1.7.0 or the dev version.

πŸ‡ΊπŸ‡ΈUnited States andysipple

Patch #33 πŸ› Ajax facet block seems to lose Views context (filters, etc) RTBC worked for me.
My current use case.
Drupal views with an exposed filter search input and exposed and the filters are exposed as a block and the view is an exposed block.
Ajax turned on for the view using with combination with views ajax history module β†’ and this patch πŸ› Facets searches don't update results RTBC .

Now ajax works and respects facets + the views exposed filter yay!

Current markup with inside a paragraph using twig tweaks:

{# Site search view exposed form #}
<div class="search-form-container">
{{ drupal_entity('block', 'site_search_form', check_access=false) }}
</div>
{# Facets #}
<div class="facets-container">
  {{ drupal_block('facet_block:content_type') }}
  {{ drupal_block('facet_block:subject') }}
  {{ drupal_block('facet_block:media') }}
</div>
{# Site search view exposed form #}
{{ drupal_view('site_search', 'site_search_default') }}
πŸ‡ΊπŸ‡ΈUnited States andysipple

Johnv,
Sorry for the late reply. I was able to solve my problem.

Answers to your questions.
>Why do you need the virgin data? It seems you are bypassing the formatters completely?
>Can you explain what you are doing?

We needed to create a separate table on the front end for regular hours and another for exceptions and do some cleanup to the way data is presented.

There didn't seem to be an easy way to separate regular hours vs exceptions.

This is what we ended up doing to create a separate array for regular hours and exceptions. The OfficeHoursDateHelper helped a ton!

use Drupal\office_hours\OfficeHoursDateHelper;

if (isset($node)) {


  if (_field_check($node, 'field_open_hours')) {
    $open_hours_data = $node->get('field_open_hours')->getValue();
    $days_of_week = [
      0 => 'Sunday',
      1 => 'Monday',
      2 => 'Tuesday',
      3 => 'Wednesday',
      4 => 'Thursday',
      5 => 'Friday',
      6 => 'Saturday',
    ];
    $open_hours_days_of_the_week = [
      'Sunday' => [],
      'Monday' => [],
      'Tuesday' => [],
      'Wednesday' => [],
      'Thursday' => [],
      'Friday' => [],
      'Saturday' => [],
    ];
    $open_hours_exception = [];

    foreach ($open_hours_data as $item) {
      $start = OfficeHoursDateHelper::format($item['starthours'], 'Hi');
      $end = OfficeHoursDateHelper::format($item['endhours'], 'Hi');
      $day = $item['day'];
      $item['starthours'] = date("g:i A", strtotime($start));
      $item['endhours'] = date("g:i A", strtotime($end));
      if (!_is_exception_day($item)) {
        $open_hours_days_of_the_week[$days_of_week[$day]][] = $item;
      }
      else {
        $open_hours_exception[$day][] = $item;
      }
    }

    // Reg hours
    if (!empty($open_hours_days_of_the_week)) {
      $variables['location']['open_hours_days_of_the_week'] = $open_hours_days_of_the_week;
    }

    // Exceptions. Limited by the display widget "Restrict exceptions display to x days in future".
    if (!empty($open_hours_exception)) {
      $variables['location']['open_hours_exception'] = $open_hours_exception;
    }
  }
}

πŸ‡ΊπŸ‡ΈUnited States andysipple

Another reroll.
Putting the following code in both returns to ensure data-loaded attribute is set true when the image is loaded in.

          image.onload = function () {
            this.setAttribute('data-loaded', true);
          };
πŸ‡ΊπŸ‡ΈUnited States andysipple

Forgot to use single quotes. Darn VSCode editor is set up to change single quotes to double.
Please use this patch.

πŸ‡ΊπŸ‡ΈUnited States andysipple

I'd like to reopen this.
I discovered when the default image is already bigger than the available width or if the responsiveImgPath === currentSrc is the same need to set the data-loaded=true.

πŸ‡ΊπŸ‡ΈUnited States andysipple

@johnv thank you for your reply.
There doesn't seem to be anything in the field settings that would allow me to adjust the cut-off date for office hours. See image β†’
I do see I can change the cut-off date for exceptions in the field widget when managing the display, but unable to set the default when just trying to get all the raw values in hook_preprocess_node.

It seems to be coming from office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterBase.php line 79

     'exceptions' => [
        'restrict_exceptions_to_num_days' => 7, // Change this to a higher number can get more exceptions
        'date_format' => 'long',
        'title' => 'Exception hours',
      ],

That then gets called in web/modules/contrib/office_hours/src/OfficeHoursFormatterTrait.php line 6

// Remove excessive exception days.
$this->keepExceptionDaysInHorizon($settings['exceptions']['restrict_exceptions_to_num_days'] ?? 0);

Appreciate your help

πŸ‡ΊπŸ‡ΈUnited States andysipple

Sure can I can create PR!
In the meantime yes absolutely can use single quotes.
See the new patch.

Production build 0.71.5 2024