Account created on 2 December 2006, over 18 years ago
#

Merge Requests

More

Recent comments

🇪🇸Spain aleix

Hi orkut,
did you saw that there's a 2.x version of the module with 10 compatibility? I'd be happy to see if it is working for you. I 'll try to check it when I end with the major effort by now; the move from mapbox gl to maplibre gl ( https://www.drupal.org/project/maplibre_gl ) ... BTW I saw your site https://geoperformans.com , so good! for any kind of collaboration just contact me :)

🇪🇸Spain aleix

Hi, sorry to necrobumping, if you think so please, omit this comment. I recently found exactly the same issue using a php in a debian with default configuration as it comes from apt repository. The way how is configured it using session.cookie_samesite = "Strict" made me waste a lot of time doing tracing here and there until I found that the cookie was stripped... So now I see, it's obvious(and I was suspecting it), and is something to be aware when using third parties auths, but I just confirmed what's said in this post.

So at least a note about it in Readme.md could help others with the same error, as the path from the error "Login failed. Invalid OAuth2 state" to the misconfigured php may be a long trace.

🇪🇸Spain aleix

Adding patch for composer purpose

🇪🇸Spain aleix

After testing, it just works.

🇪🇸Spain aleix

True, I removed all composer requirements as only info.yml ones are needed in this case. thank you

🇪🇸Spain aleix

It was completely unusable, I'll check it out next time... so sorry all to release this non-functional tag. Anyway, now I checked it and released a new one with functional code and some nest fixes: https://www.drupal.org/project/address_js_geocoder/releases/2.0.0-alpha6

🇪🇸Spain aleix

Wow completely missed that... sorry. You are absolutely true. With this release: https://www.drupal.org/project/address_js_geocoder/releases/2.0.0-alpha6 (which includes this big commit: https://git.drupalcode.org/project/address_js_geocoder/-/commit/e5b95cfe... I have refactored things a little.
So: no more jquery.once and the formatter uses the formatter plugin from geocode like this https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.x/src/Plugin/Ge... to follow the recommendations of https://geocoder-php.org/docs/#formatters

I hope it will help you, if not I'll check your patch.

🇪🇸Spain aleix

I couldn't test it by now, until next week I cannot check it out, but I could merge the MR if you can tell me please if geocoding is working as it should without any map in form , also if there's any error or message in browser console when trying to geocode any address.

I think that it must not depend on geofield_map module because geocoding must work without it, but maybe it tries to refresh something there...

🇪🇸Spain aleix

Just merged (noisy commit for what it is...) into 2.0.x

🇪🇸Spain aleix

aleix changed the visibility of the branch project-update-bot-only to active.

🇪🇸Spain aleix

aleix changed the visibility of the branch project-update-bot-only to hidden.

🇪🇸Spain aleix

aleix changed the visibility of the branch project-update-bot-only to hidden.

🇪🇸Spain aleix

Thank's for replying @akoepke, I am just writing again to let you know that I have created a minimal module to get this feature, as you said with a new plugin (also packing a block to inform the user of the rate limiting), it's in :

https://www.drupal.org/project/paywall_rate_limit/

I also created a new module to implement a paywall plugin depending on the subscription of a given simplenews , in:
https://www.drupal.org/project/paywall_simplenews_subscription

Your module helps a lot ! thank you!

🇪🇸Spain aleix

I requested to merge part of the proposal in dfp project.

However, reading the notes in https://klaro.org/blog/klaro-and-the-new-google-requirements-for-cmps-tcf- it seems that implementing google consent to satisfy ad personalization purposes makes no sense if what is wanted is to implement adsense and admanager as this will never happen for what could be read in https://klaro.org/blog/klaro-and-the-new-google-requirements-for-cmps-tcf- ...

Anyway, that work is there if sometime in the future google is forced to change the way is trying to comply with gprd within their ads service...

🇪🇸Spain aleix

!27 MR was using bad branch dest...
!28 is the good one , with these changes, minor preprocess needs to be done to make it work with klaro. something like:

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_js_head_top(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');

  $service = $helper->matchKlaroApp($variables["google_tag_services_url"]);
  if ($service) {
    $variables['gads_dataset'] = [
      'type' => 'text/javascript',
      'name' => 'dfp_admanager',
      'src'  => $variables["google_tag_services_url"],
    ];
  }
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_short_tag(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');
  $service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
  if ($service) {
    $variables['image_attributes'] = $helper->rewriteAttributes($variables['image_attributes'], $service->id());
  }
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_tag(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_js_head_bottom(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_slot_definition_js(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
}

/**
 * Adds the klaro attributes to each script preprocessed by dfp.
 */
function _dfp_klaro_preprocess_dfp(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');
  $service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
  if ($service) {
    $variables['script_attributes'] = $helper->rewriteAttributes($variables['script_attributes'], $service->id());
  }
}

🇪🇸Spain aleix

Thanks @szeidler, that's what I end up doing. But rather than editing the template directly, it's done in a way that if at some moment klaro is not used, the templates will work. I'll ping also dfp guys to check it out, maybe they could propose some other way...

Dfp adds the remote js script https://securepubads.g.doubleclick.net/tag/js/gpt.js using an inline script, but adding the klaro attributes to the inline script didn't help, so I need to add the klaro data attributes to this remote js

, so via preprocess, if we are using klaro to consent the service, a new variable 'gads_dataset' is added:
/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_js_head_top(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');

  $service = $helper->matchKlaroApp($variables["google_tag_services_url"]);
  if ($service) {
    $variables['gads_dataset'] = [
      'type' => 'text/javascript',
      'name' => 'dfp_admanager',
      'src'  => $variables["google_tag_services_url"],
    ];
  }
}
These new variable will be used in current theme template dfp-js-head-top.html.twig, it's done in a way that if at some moment klaro is not used the templates will work too:
<script>
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
  // Add a place to store the slot name variable.
  googletag.slots = googletag.slots || {};

  (function() {
    var useSSL = 'https:' == document.location.protocol;
    var src = (useSSL ? 'https:' : 'http:') +
      '//{{ google_tag_services_url }}';

    {% if async_rendering -%}
    var gads = document.createElement('script');
    gads.async = true;
    {% if gads_dataset -%}
      {% for property, value in gads_dataset -%}
        {% if property != 'src' -%}
          gads.dataset['{{ property }}'] = '{{ value }}';
        {%- endif %}
      {%- endfor %}
    {%- endif %}
    {% if gads_dataset['src'] -%}
      gads.dataset.src = src;
    {% else -%}
      gads.src = src;
    {%- endif %}
    var node = document.getElementsByTagName('script')[0];
    node.parentNode.insertBefore(gads, node);
    {% else -%}

    document.write('<scr' + 'ipt
    {% if gads_dataset -%}
      {% for property, value in gads_dataset -%}
        {% if property != 'src' -%}
          data-{{ property }}="{{ value }}"
        {%- endif %}
      {%- endfor %}
    {%- endif %}
    {% if gads_dataset['src'] -%}
      data-src="' + src + '"
    {% else -%}
      src="' + src + '"
    {%- endif %}
    ></scr' + 'ipt>');
    {%- endif %}

  })();
</script>

The short tag template is also controlled by klaro, this time the image attribute is defined with class Attribute, this way we could use the klaro helper to rewrite the attributes. The rewrite is done, like the previous template, if klaro dfp service is enabled.

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_short_tag(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');

  $variables['image_attributes'] = new Attribute(array(
    'src' => $variables['url_ad'],
  ));

  $service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
  if ($service) {
    $variables['image_attributes'] = $helper->rewriteAttributes($variables['image_attributes'], $service->id());
  }
}

So the dfp-short-tag.html.twig in current theme is like:
<a href="{{ url_jump }}">
  <img {{ image_attributes }}>
</a>
Then I create a common function to be used in dfp_js_head_bottom, and dfp_slot_definition_js and dfp_tag preprocess functions. Used to rewrite the script attributes to comply with klaro requirements if service is enabled.
/**
 * Adds the klaro attributes to each script preprocessed by dfp.
 */
function _dfp_klaro_preprocess_dfp(&$variables)
{
  /** @var \Drupal\klaro\Utility\KlaroHelper $helper */
  $helper = \Drupal::service('klaro.helper');

  $variables['script_attributes'] = new Attribute(array(
    'type' => 'application/javascript',
  ));

  $service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
  if ($service) {
    $variables['script_attributes'] = $helper->rewriteAttributes($variables['script_attributes'], $service->id());
  }
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_js_head_bottom(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_slot_definition_js(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
}

/**
 * Implements hook_preprocess_HOOK() for dfp templates.
 */
function dfp_klaro_preprocess_dfp_tag(&$variables)
{
  _dfp_klaro_preprocess_dfp($variables);
  // to be able to show box to allow show content
  $variables['tag_attributes'] = new Attribute(
    array(
      'class' => ['dfp-tag-slot'],
    )
  );
}
So their template dfp-js-head-bottom.html.twig, dfp-slot-definition-js.html.twig will be a copy of the original but replacing the hardcoded script attributes with the twig script_attributes variable:
<script {{ script_attributes }}>
Note that the preprocess function dfp_klaro_preprocess_dfp_tag will also append the new class dfp-tag-slot to each dfp tag, this way we could add this class in classes with additional wrapper field in klaro service settings, so then a box to let user load the content will be there. The template dfp-tag.html.twig is like this:
<div id="{{ tag.placeholderId }}" {{ tag_attributes }}>
    {% if tag.isSlugHidden == false and tag.slug %}
        <div>
            {{ tag.slug }}
        </div>
    {% endif %}
    <script {{ script_attributes }}>
    {% if tag.isAsyncMode %}
        googletag.cmd.push(function() {
    {% endif %}
            googletag.display('{{ tag.placeholderId }}');
    {% if tag.isAsyncMode %}
        });
    {% endif %}

    </script>
</div>
Finally the config of the klaro service is like this:
status: true
dependencies: {  }
id: dfp_admanager
label: 'Google Ads'
description: 'Integrates DFP Google Publisher Tags onto the site'
default: false
purposes:
  - advertising
cookies: {  }
required: false
opt_out: false
only_once: false
info_url: 'https://admanager.google.com/home/'
privacy_policy_url: 'https://policies.google.com/privacy'
javascripts:
  - 'https://securepubads.g.doubleclick.net/tag/js/gpt.js'
  - 'https://pubads.g.doubleclick.net/gampad'
  - securepubads.g.doubleclick.net/tag/js/gpt.js
callback_code: "window.dataLayer = window.dataLayer || [];\r\nfunction dfp_gtag() {\r\n  dataLayer.push(arguments);\r\n}\r\nif (consent){\r\n\r\n                // we grant ad storage and personalization\r\n                dfp_gtag('consent', 'update', {\r\n                    'ad_storage': 'granted',\r\n                    'ad_user_data': 'granted',\r\n                    'ad_personalization': 'granted'\r\n                })\r\n} else {\r\n                // we decline ad storage and personalization\r\n                dfp_gtag('consent', 'update', {\r\n                    'ad_storage': 'denied',\r\n                    'ad_user_data': 'denied',\r\n                    'ad_personalization': 'denied'\r\n                })\r\n}"
wrapper_identifier:
  - dfp-tag-slot
attachments: {  }
weight: -5
Note that the callback code will be:
window.dataLayer = window.dataLayer || [];
function dfp_gtag() {
  dataLayer.push(arguments);
}
if (consent){
                // we grant ad storage and personalization
                dfp_gtag('consent', 'update', {
                    'ad_storage': 'granted',
                    'ad_user_data': 'granted',
                    'ad_personalization': 'granted'
                })
} else {
                // we decline ad storage and personalization
                dfp_gtag('consent', 'update', {
                    'ad_storage': 'denied',
                    'ad_user_data': 'denied',
                    'ad_personalization': 'denied'
                })
}
So it will implement consent mode V2 changes as told in https://klaro.org/docs/tutorials/google_tag_manager (The dfp_gtag is used because gtag function is not defined yet, because the script is executed before the gtag.js in google_tag module.
🇪🇸Spain aleix

Created a new branch and a patch with the changes to try to support the current D11. Knocking to request a review please!

🇪🇸Spain aleix

Great @bkenro ! Your feedback/contributions are welcome.

🇪🇸Spain aleix

I am sorry but I couldn't reproduce despite I installed everything from your repo from the scratch, I have set the php environment again with php8.3.
What I see was that the load of the filepicker inside the modal was triggering:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 134217736 bytes) in drupal-project/vendor/mck89/peast/lib/Peast/Syntax/Utils.php on line 37

And the filepicker was not appearing (I am using firefox, maybe in chromium i could see your modal error). The error was the same if setting the entity browser to be standalone form .

I have not inspected too deeply but I suppose that it's because i was using js aggregation or the load of nc filepicker libraries together with xdebug , a low memory_limit and 30 seconds of execution limit for php.
Anyway disabling xdebug make it work...

Maybe you have xdebug enabled? or low php memory_limit ?

I try to inspect a little more if this js load could be reduced, or try to load differently the vue filepicker (async???) to prevent this wait and allow the use of xdebug but by now disabling xdebug just to allow the load (after first load it may be enabled again) it's the way to make it work (if you face with the same xdebug issue) .

🇪🇸Spain aleix

I try to reproduce, but no way... The key error in:

TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 424 of /var/www/demo/web/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php).

refers to entitybrowser, could you paste the entitybrowser config from single export in config > development and also the entity form view of the article content ?

(also the answers to the questions in previous comment could help)

...

Let's see if we can solve this.

🇪🇸Spain aleix

Great! let's see, It happens before loading the node form or after submitting the node form?
As I said, filling the media via media form, without using entity browser is not implemented (it must be at some moment).

🇪🇸Spain aleix

Hi @bkenro . Let's see if you did the required setup. Did you picked the remote share with the filepicker in widget field? Or just filled the field url with the remote url? If thats the case i am sorry but just using the url without using the picker will not populate the metadata, (but it may be implemented at some point)

To confirm and be more specific, i need more information to reproduce. Could you send the configuration of the next cloud media image? the ymls of the media, the yml of the view modes and form modes, the yml of the field storage and formatter... If not a screen capture video may help.

🇪🇸Spain aleix

Added a checkbox to let user choose if defaults needs to be imported in config form, i hope it suits your needs too.

🇪🇸Spain aleix

Sounds good, let's do it, I'll take a look asap. I'll try to merge every one of your proposals in next days.

🇪🇸Spain aleix

Finally 11 version there ! will tag as beta

🇪🇸Spain aleix

Great! Thank you ankitv18. I will release it as soon as ci tests that are running now pass.

🇪🇸Spain aleix

Hi, I just created a MR ... It's about the same thing but is done using the core Actions API with a derivative that could be executed from any view. So I think it's easier because with any terms view it could be called.
It may be used this in a new view with `/admin/structure/taxonomy/manage/%taxonomy_vocabulary/merge_terms` path that is restricted to a one defined vocabulary.

🇪🇸Spain aleix

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

🇪🇸Spain aleix

I see, there are some issues with configurations...i'll take a look asap. thank's for reporting.

🇪🇸Spain aleix

Sure, it sounds good to me, as soon as I can work on it I'll take a look.

🇪🇸Spain aleix

Excuse the necrobump, not exactly what is looking for, but I want to be disabled if no query has been made, so it could be based on this to disable if no results.

So just for future references setting a flag like:

function yourtheme_preprocess_search_api_sorts_sort(&$variables) {
  $variables["searching"] = !empty(\Drupal::request()->query->all());
}

make it possible to wrap sorts links in template search-api-sorts-sort.html.twig

{% if searching %}
  <button ...>
{% endif %}
🇪🇸Spain aleix

Hi, i face the same issue. It's on ckeditor plugins side, and the bad news is that it will not work by now neither with 10.4 nor with what's been doing in 11.x by now, as the maximum version ckeditor used is 42.0.0 by now . To be aware of which version is using drupal, there's this file that could be checked on each drupal version in https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/ckedi...

X.com and Reels embedding functionalities are merged in ckeditor 43.1.0 : https://github.com/ckeditor/ckeditor5/commits/v43.1.0/packages/ckeditor5...
Youtube shorts embedding functionalities are merged in ckeditor 43.2.0 : https://github.com/ckeditor/ckeditor5/blob/v43.2.0/packages/ckeditor5-me...

So if you need these embedding features you'll need to cherry pick the commits and rebuild the package. There's some guidance of how can be done in
https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...

What I've done is:

git clone https://github.com/ckeditor/ckeditor5.git
cd ckeditor5
#lookup for the version of ckeditor packed in your drupal (you could check in site report page or in /core/modules/ckeditor5/js/build/ckeditor5.types.jsdoc );
#for 10.3.x : 41.3.1
#for 10.4.x : 42.0.0
#checkout the tag matching the version.
git checkout tags/v41.3.1
# lookup for commit hashes (that's pickable) https://github.com/ckeditor/ckeditor5/commits/v43.3.0/packages/ckeditor5-media-embed/src/mediaembedediting.ts
# for x.com and reels:
git cherry-pick 6cd9dc30089116f7481ce52b067245eb2e8678bf
# for youtube shorts:
git cherry-pick bba1f7f59ce887c08d107a11bf1124363a358de4
yarn install
yarn dll:build

After building, replacing at least the build in web/libraries/media-embed/ with the one just built in packages/ckeditor5-media-embed will enable the embedding of these providers.

🇪🇸Spain aleix

I found the same when it was half installed because faulty php settings, timeout or so. This must not happen when using "drush en", I suspect that the problem here is not in commerce module but in server environment, so it's a support request rather than a commerce issue.

Anyway, I need to reinstall the 'cart' field definition existing in commerce_cart_entity_base_field_info , using the method:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

To call this, one can call it just before the uninstallFieldStorageDefinition called in core/lib/Drupal/Core/Extension/ModuleInstaller.php:497 uninstall method:

+$update_manager->uninstallFieldStorageDefinition('cart', $entity_type->id(), 'commerce_cart, $storage_definition);
$update_manager->uninstallFieldStorageDefinition($storage_definition);

If trying to reinstall commerce_cart complains about existing core.entity_view_mode.commerce_product_attribute_value.add_to_cart, then the conf may need to be deleted (drush cdel can do it)

🇪🇸Spain aleix

Thank's, yes maybe css could be simplified (but little example about how to add scss to components may illustrate someone).

🇪🇸Spain aleix

After trying to integrate the feature request in previous comment I end up creating a module with simplified behavior: a simple checkbox to relate the referenced entities if possible it could be found here: https://www.drupal.org/project/group_relationship_inheritance , sorry for the noise guys.

🇪🇸Spain aleix

Sorry to necrobumping this, but I think that there's a use case: Imagine a course group that has chapters and resources as group content, resources are created in chapters through inline entity form, but they need to be added to group too. So a clean way may be to add entitygroupfield prepopulated from ief form alter getting the route parameters. Now is so difficult to reach there from form alter, so the same way the form element has 'excluded_groups' it could have the 'preselected_groups' element property.
This use case is also there when there are references to media in group content that must be confined to group it's commonly desired to inherit the group relationship from parent content.

🇪🇸Spain aleix

@john-frnklin I am sorry but I am on vacation now, in September I'll start a commerce implementation in a working site, I'll check it out then. I keep the mail notification flagged to keep in mind.

🇪🇸Spain aleix

Thank's @doxigo , much better now. so now I can use title_attributes: title_attributes in node templates

🇪🇸Spain aleix

aleix changed the visibility of the branch 3100572-not-supporting-entity to hidden.

🇪🇸Spain aleix

@berdir as a maintainer of both modules, I imagine that there will be things that I miss, but anyway it's a start, I can use entitybrowser with err with this fieldwidgets plugin that mimics what is done in err widget plugin extended class.

🇪🇸Spain aleix

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

🇪🇸Spain aleix

Sure, thanks for contributing. I merged it, but also namespacing de dependency as in https://www.drupal.org/docs/develop/creating-modules/let-drupal-know-abo...

🇪🇸Spain aleix

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

🇪🇸Spain aleix

I am just testing but just adding

starterkit: true

to https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/start... lets me run

php web/core/scripts/drupal generate-theme --starterkit ui_suite_bootstrap_subtheme_example mytheme

🇪🇸Spain aleix

Just reporting that without the 'to' sendgrid transport that comes with symfony_mailer cannot work.

The to array is required for all personalization objects, and must have at least one email object with a valid email address.

`http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#messa...`

🇪🇸Spain aleix

Finally passing, waiting for review now.

🇪🇸Spain aleix

As the tests in ci are failing... I'll check asap

🇪🇸Spain aleix

After adding the conditional, tests confirm that tickets Field tickets is unknown errors are not there anymore :) .

Adding critical as this issue breaks some sites that are mixing orders with enabled and disabled tickets...

🇪🇸Spain aleix

In fact it doesn't affect only the assign event, it will affect the events without the conditional that checks if order entity hasn't the tickets field. The test in MR shows just the assign and paid event. But It's clear that the subscription will affect orders without tickets enabled, and testing all events will add noise to test files.

🇪🇸Spain aleix

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

🇪🇸Spain aleix

Gracias pedro, Do you think you could review proposed patches or just the ones RTBC? I have it working on production so maybe I could help with main features (in fact I proposed these by now). Namely:

- Theming capabilities.
- Symfony mailer support.
- Fix the sending in some contexts.

As you said somewhere maybe a new release could help. That said maybe someone in this issue could join the efforts to keep this module with a clear future (or claim for help in main commerce module...)

BTW @pcambra i am also aleix in drupal.cat tg group if you want to talk about it.

Production build 0.71.5 2024