Arezzo
Account created on 15 September 2008, about 16 years ago
  • Senior Drupal Analyst & Developer at MGI 
#

Recent comments

🇮🇹Italy maurizio.ganovelli Arezzo

Maybe that the problem comes from Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin::isAdminPath. The route views.ajax with path /views/ajax is never considered as administrative, so user preferred admin language is not applied to views ajax calls.

🇮🇹Italy maurizio.ganovelli Arezzo

The popup visible on your screenshot came from Chrome auto-translation feature, if possible turn it off for the tests.
I tried with Chrome too (all previous tests are done on Firefox) but i get the same behavior you can see on screencast.
I'll try to do a debug session in next days to investigate furthermore.

🇮🇹Italy maurizio.ganovelli Arezzo

Thank you, for reply!
I hadn't the "Follow the user's language preference" flag active on "Detection and selection" page: I've tried with this change but only partially solves the problem. Now works but only when language prefix in not on url.
Try adding a new language, let's say French, keeping all other settings as already defined.
Visit /fr/admin/content: view is rendered in English (admin language) but if i try to click on filter ajax callback renders views in French (url language).
Attached a short screencast (i'm using Drupal 10.2.6).

🇮🇹Italy maurizio.ganovelli Arezzo

The issue is still relevant to 4.0.1 version but latest patch from comment #4 still applies and solves it.

🇮🇹Italy maurizio.ganovelli Arezzo

This issue seems to be resolved in version 2.0.6 of this project, patch is not needed (and doesn't apply) anymore.

🇮🇹Italy maurizio.ganovelli Arezzo

I have a problem that seems related to this. After updating BAT module from rc to stable 10.1 version, viewing a commerce order (from backoffice) i get this error:

InvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (linea 137 di /app/web/core/modules/views/src/ViewsData.php).

removing the line "data_table" in annotation and clearing caches, view seems to work normally.

🇮🇹Italy maurizio.ganovelli Arezzo

Thanks for feedback, changing issue status to Needs review.

🇮🇹Italy maurizio.ganovelli Arezzo

Hi,

the issue is not limited to Olivero, I can replicate with every theme.
Please make sure you changed some configuration options (default values don't give any issue) in /admin/config/pwa/pwa_extras: try to flag some fields and select a mask icon color.

This is a part of html head of a bootstrap based theme:

...
<meta charset="utf-8" />
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#8ae234" />
<p></p>
<meta name="Generator" content="Drupal 10 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
...

I have a vanilla Drupal 10.2.5 with PWA 2.1.0-beta5.
I confirm also that disabling pwa_extras, the problem disappears.

🇮🇹Italy maurizio.ganovelli Arezzo

I have the same problem and extra metatags are not printed at all. This seems to be caused by values passed to DOMDocument::loadHTML that are html encoded. Attached a quick solution that works in my case but i'm not sure if it's optimal.

🇮🇹Italy maurizio.ganovelli Arezzo

Yes, you can protect files and media attached to an entity instance (a node, a paragraph, so on).

🇮🇹Italy maurizio.ganovelli Arezzo

I'm going to close older issues, feel free to reopen if still relevant.

Opening form in modal is possible by injecting some attributes in link generated by the module formatter using hook_webform_attachment_gated_download_url_alter().

Something like this:


function mymodule_webform_attachment_gated_download_url_alter(Url $uri, $item) {
  $options= $uri->getOptions();
  $options['attributes']['class'][] = 'use-ajax';
  $options['attributes']['data-dialog-type'] = 'modal';
  $options['attributes']['data-dialog-options'] = json_encode(
    [ 'autoOpen' => FALSE,
      'title' => t('Confirm form'),
    ]
  );
  $uri->setOptions($options);
}

🇮🇹Italy maurizio.ganovelli Arezzo

Attached patch removes canonical link annotation.

🇮🇹Italy maurizio.ganovelli Arezzo

Thank you, patch works well in my case but EntityInterface namespace is missing. Attached patch adds it to class file.

🇮🇹Italy maurizio.ganovelli Arezzo

I have a similar problem in 2.x version too; i'm trying to give access to a specific group role to all submissions of a specific webform.
In Drupal\webform_group\WebformGroupManager the function getCurrentGroupRelationship return always FALSE due to:
$source_entity = $this->requestHandler->getCurrentSourceEntity(['webform_submission']);
returning always a NULL value fot paths like "node/X/webform/results/submissions".
I tried to extract node parameter from current route but without luck (i found no route name nor route parameters in request using \Drupal::routeMatch()).
As a temporary quick & dirty fix (for nodes only) i use:

    $source_entity = $this->requestHandler->getCurrentSourceEntity(['webform_submission']);
    if (!$source_entity) {
      if (preg_match("/^(\/.*)?\/node\/([1-9][0-9]*)\/webform\/results\/(submissions|download)$/", \Drupal::service('path.current')->getPath(), $matches)) {
        $source_entity = $this->getEntityStorage('node')->load($matches[2]);
      }
      if (!$source_entity) {
        return $this->currentGroupRelationship;
      }
    }

I'm sure that there is a better solution than raw url pattern matching .. any idea is welcome!

🇮🇹Italy maurizio.ganovelli Arezzo

The patch works well but needs to be modified slightly for D10 compatibility (note that automated patches in https://www.drupal.org/project/change_user_route/issues/3286445 cannot be applied upon this patch).

🇮🇹Italy maurizio.ganovelli Arezzo

I confirm that patch works, and can be applied, also for 3.x branch.

🇮🇹Italy maurizio.ganovelli Arezzo

Hi Aditi, thank you for replying, pager links take current route if #route_name is not specified. This is by default. If you need to specify an alternative route with parameters (in my case i have a tableselect with an ajaxified pager in a modal popup), you need to pass also #route_parameters in the render array. This already works as expected but it's not documented in Pager.php class.

🇮🇹Italy maurizio.ganovelli Arezzo

I encountered a similar issue on a view with custom entities and using the new version 1.6 error disappears.

🇮🇹Italy maurizio.ganovelli Arezzo

Using only this condition:
\Drupal::request()->get(MainContentViewSubscriber::WRAPPER_FORMAT) === 'drupal_modal'
seems to fail in some use cases.
I have a modal form with ajax submit and tableselect element with pager. Applying this patch, pager links get ajaxified and work well until a validation error occurs. During submit, request wrapper format is "drupal_ajax", so after validation fails condition does not pass and links don't have use-ajax class and data attributes anymore.
Adding this:
in_array(\Drupal::request()->get(MainContentViewSubscriber::WRAPPER_FORMAT), ['drupal_ajax', 'drupal_modal'])
make pager work also after a failed validation, but i don't know if this can have unwanted side effects.

🇮🇹Italy maurizio.ganovelli Arezzo

Rerolled against latest 2.x-dev branch.

🇮🇹Italy maurizio.ganovelli Arezzo

I don't know if this is the right place to post, since issue is closed, but this patch needs a fix to avoid the php notice "Only variables should be passed by reference" on array_pop() function call.

🇮🇹Italy maurizio.ganovelli Arezzo

Hi Andy thank you for proposal, i still actively maintain this module for some of my customers (they still on D9 but i opened 2.x branch for D10 compatibility if you need it). Feel free to send patches (for example Symfony Mailer integration must be reviewed as per https://www.drupal.org/project/symfony_mailer/issues/3355626 📌 Obsolete the symfony_mailer_bc module Fixed ), i'll be happy to test, review and eventually commit them.

🇮🇹Italy maurizio.ganovelli Arezzo

I made yml changes in 8.x-2.x-dev branch for D10 compatibility.

🇮🇹Italy maurizio.ganovelli Arezzo

Same problem also with 3.0 branch. I managed to solve by removing file prefixing, not sure if it's the right way, but seems to work.

Production build 0.71.5 2024