Lausanne
Account created on 15 January 2014, almost 11 years ago
#

Merge Requests

More

Recent comments

🇨🇭Switzerland wengerk Lausanne

Here is the rerolled patch for release 8.x-3.10.

🇨🇭Switzerland wengerk Lausanne
+++ b/src/Plugin/Commerce/PaymentGateway/PostFinanceCheckout.php
@@ -822,6 +825,14 @@ class PostFinanceCheckout extends OffsitePaymentGatewayBase implements PostFinan
+        // Prevents \Drupal\commerce_payment\EventSubscriber\OrderPaidSubscriber::onPaid
+        // to place the order on cancellation.
+        if ($state === 'canceled') {
+          $order = $order_storage->loadForUpdate($payment->getOrderId());
+          $order->state->value = 'canceled';
+          $order->save();
+        }
+

I was unable to find a more effective way to prevent the order from being placed automatically.

In our project, when the payment status was changed to 'canceled,' the system placed the order instead of canceling it, triggering the 'placed' transition and sending out order-related emails and other actions.

Is there a better approach to handle order cancellations without triggering the order placement process?

🇨🇭Switzerland wengerk Lausanne

I'm not sure in markdown files we should break lines on any code examples. Even if phpcs says so, this is not a very good practice and make the code less readable.

People who copy the commands from the markdown files would have problems, if the command is split in two lines.

It is possible to tell phpcs to ignore a rule for the full file.
We should look at what Devel did with a phpcsxml dist file and ignore the 80 limit chars for markdown files
https://www.drupal.org/project/devel/issues/3133703

I'm in favor of reverting changes on:

  • FILE: factory_lollipop\UPGRADING.md. Change lines length except codes sample & command line
  • FILE: factory_lollipop\README.md. Change lines length except codes sample & command line
  • FILE: factory_lollipop\CONTRIBUTING.md. Change lines length except codes sample & command line.
  • FILE: factory_lollipop\CHANGELOG.md: Keep it intact. We use Keep a Changelog format
🇨🇭Switzerland wengerk Lausanne

Openned an issue fork to run tests againts patch. I found some mistake on the rerolled patch in #50 and fix thoses issues on the Fork.
Seems to works now. I just rerolled the patch and change this code.

  public function pageTitle($page_manager_page_variant) {
    if (is_string($page_manager_page_variant)) {
        $page_manager_page_variant = $this->entityRepository->loadEntityByConfigTarget('page_variant', $page_manager_page_variant);
    }

to this

  public function pageTitle(Request $request) {
    $attributes = $request->attributes->all();
    if (!isset($attributes['_page_manager_page_variant'])) {
      return '';
    }

    if (is_string($attributes['_page_manager_page_variant'])) {
      $page_manager_page_variant = $this->entityRepository->loadEntityByConfigTarget('page_variant', $attributes['_page_manager_page_variant']);
    } elseif ($attributes['_page_manager_page_variant'] instanceof PageVariantInterface) {
      $page_manager_page_variant = $attributes['_page_manager_page_variant'];
    } else {
      return '';
    }
🇨🇭Switzerland wengerk Lausanne

wengerk changed the visibility of the branch 2752227-incorrect-pagetitle-title to hidden.

🇨🇭Switzerland wengerk Lausanne

Rerolled patch for Drupal 10.3.x

🇨🇭Switzerland wengerk Lausanne

Many thanks for rerolling this patch !! Would you create an issue Fork in order to run tests against it ? It would definitely help, I'm sure. If you don't have time, I can open it later this month.

🇨🇭Switzerland wengerk Lausanne

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

🇨🇭Switzerland wengerk Lausanne

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

🇨🇭Switzerland wengerk Lausanne

Please re-open if you still have some questions about this security bamboo twig component.

🇨🇭Switzerland wengerk Lausanne

Hello Nigelwhite,

You can find the answer on the documentation > Usage > Security

The bamboo_has_role function returns a boolean if the current|given user has the requested role.

  • param1, role string.
  • param2, user int - User id instead of the current logged user.
{% set user_id = 1 %}

{# Does the given user have the given role ? #}
{{ bamboo_has_role('authenticated', user_id) ? 'TRUE' : 'FALSE' }}
🇨🇭Switzerland wengerk Lausanne

add how-to

🇨🇭Switzerland wengerk Lausanne

add content to explain resolvers default state and how to enable them

🇨🇭Switzerland wengerk Lausanne

change page order

🇨🇭Switzerland wengerk Lausanne

change page order

🇨🇭Switzerland wengerk Lausanne

Remove the module as related content, it's obvious.

🇨🇭Switzerland wengerk Lausanne

Improve summary

🇨🇭Switzerland wengerk Lausanne

For thos willing to help reviewing the code, you can integrate this patch in a Drupal project using Composer & cweagans/composer-patches.

  1. Update your composer.json file to apply the patch.

      "extra": {
          "patches": {
            "drupal/nbsp": {
              "Splitting the links in two - 3432756": "https://git.drupalcode.org/project/nbsp/-/merge_requests/14.patch"
            }
          }
        }
      
  2. run the command composer update drupal/nbsp in order to apply the patch
  3. Review the changes in your Drupal UI
🇨🇭Switzerland wengerk Lausanne

I've made a new batch of fix about how the command inject the nbsp tag. Should now propertly keep all AttributeElement and not break them (eg. breaking links).

🇨🇭Switzerland wengerk Lausanne

Branch 2.x will never reach Drupal 11.
Only branch 3.x will be maintained on Drupal 11 as Drupal 11 will drop CKEditor 4 support.

🇨🇭Switzerland wengerk Lausanne

Thank you for reaching out and interest in this module! Indeed, as of now, it's not supported within the project.

I've been pondering a potential solution to this issue: creating a separate project called "Editor Advanced Media."
This could help us avoid bloating the main module and ensure better modularity.

While I may not have the bandwidth to add the feature myself at the moment, I'm committed to supporting and reviewing any contributions made towards it.
Please feel free to share any thoughts or suggestions you may have on this matter.
Your feedback helps shape the future direction of the project.

🇨🇭Switzerland wengerk Lausanne

It was a schema issue as pointed by ksenzee on Slack https://drupal.slack.com/archives/C01GWN3QYJD/p1714662493560729?thread_t...

To solve the problem, I just changed the schema

    schema.register("nbsp", {
      allowWhere: '$text',
+      allowAttributesOf: '$text',
      isInline: true,
+      isObject: true
    });
🇨🇭Switzerland wengerk Lausanne

Merging in progress many, many thanks for your huge contribution to the project improvement mvogel

🇨🇭Switzerland wengerk Lausanne

wengerk changed the visibility of the branch 3337618-ckeditor-5-default to hidden.

🇨🇭Switzerland wengerk Lausanne

Here a new MR with the code https://git.drupalcode.org/project/editor_advanced_image/-/merge_request...

Now that the module implements Gitlab-CI it will be easier to works & run tests.
Can you review and tests this in order to merge it mvogel ?

🇨🇭Switzerland wengerk Lausanne

Many thanks to everyone who has been following the changes and development of Google Tag 2.x.

I will quickly tag this module as deprecated and link it to Google Tag 2.x as a replacement.
Additionally, I will direct users to this issue thread.

Here is the text that will appear on the project page. Do you have any suggestions or changes before publishing it, later today ?!

Commerce Google Tag Manager has been deprecated and recommends transitioning to the Google Tag module, up to release 2.x, as a direct replacement.
Originally developed as a straightforward integration for Commerce applications, Google Tag now fully supports most features of this module, rendering it unnecessary.
For a comprehensive report on backported features and any missing functionalities, please refer to issue #3357144 Support Google Tag 2.x Module Active .

🇨🇭Switzerland wengerk Lausanne

We utilize the insertContent function to inject HTML into CKEditor 5, which appears to be the recommended method for injecting model fragments (such as <nbsp>&nbsp;</nbsp>).

Referencing our implementation in the nbspCommand.js file.

However, we've encountered an issue where using insertContent within a link results in the link being split, as noted by @luci_ole.
Despite searching the CKEditor 5 documentation and the Github Issue Queue, we haven't found a solution to prevent this behavior.

Any assistance in resolving this issue would be greatly appreciated. If any maintainers or individuals are aware of modules or implementations that successfully insert HTML within a link in CKEditor 5, we would be eager to examine their approach.

🇨🇭Switzerland wengerk Lausanne

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

🇨🇭Switzerland wengerk Lausanne

Thanks for your complete feedback, I'm fully open to receive a MR to change the behavior of the module if you have some time to help.

🇨🇭Switzerland wengerk Lausanne

I suspect that the cookie is not being set on your browser. ... And since you have activated the Fallback browser, you are constantly redirected to the language of your browser. On this production site https://shop.swisstopo.admin.ch, when you switch languages and navigate the site, then return to the homepage with https://shop.swisstopo.admin.ch, are you properly redirected to your last navigation language? If not, then it seems that your browser or an extension of it is preventing the home_redirect_lang_preferred_langcode cookie from being set.

🇨🇭Switzerland wengerk Lausanne

I tested following your given steps in the issue summary and on my side, everythings works as intended. When I change my lang from any page (homepage or any other) then when navigating the Homepage I'm redirected to the last language I visit the website.

When you inspect your Cookies, you should see a Cookie nammed home_redirect_lang_preferred_langcode that should be filled with the last choosen language - does it works ?

What are the language you enabled ? I tested with French (fr) and English (en). Maybe the module have an issue with some language, could you provide me the language you enabled on step "Enabled all modules of the multilingual section".

🇨🇭Switzerland wengerk Lausanne

I'll take a look when used with the default language switcher.

We use this module on 2 huge projects without any problems, but we use a custom approach as described in the README/Module description with our own JS. I think the default JS given by the module does not work anymore with the Drupal default language switcher, since Drupal changed the default language switcher when released Olivero.

If you want to fix it quicly, I suggest you to add a custom JS that triggered when clicking on the language link

// Prevent attempting to attach cookie if the common library is not available.
if (typeof Drupal.homeRedirectLang == "undefined") {
  return;
}

# Change the selector here for your own class on <a> of language switcher.
let links = document.querySelectorAll('.language-link');

links.forEach(link => {
  link.addEventListener('click', function (event) {
    var hreflang = event.target.getAttribute('hreflang');
    Drupal.homeRedirectLang.setPreferredLanguage(hreflang);
  });
});
🇨🇭Switzerland wengerk Lausanne

Do you use the standard Drupal language switcher or your own switcher ?

If you use the standard Drupal language switcher, do you have some error in your Console ?

🇨🇭Switzerland wengerk Lausanne

re-rolled patch for Drupal 10 compliancy.
Replace drupal_get_path in favor of extension listing services .

See Drupal Core changes https://www.drupal.org/node/2940438

An improvment could be to use dependency injection of extension.list.module instead of using \Drupal::service.

🇨🇭Switzerland wengerk Lausanne

Many thanks for your consideration and answer.
I totally understand your point of view.
I still reckon using aliases for Attribute is a smart move, just like Symfony does. Let me proceed with why.

There's this discussion in the community (https://github.com/symfony/symfony/discussions/45525) that backs up this convention.
I'll sum up one of the responses below for easier reading:

Having alias provides additional context to what you're doing, especially when you're in a class that might be using attributes from multiple packages. Suppose you have a class User with validation constraints and Serialization, it wouldn't be all that farfetched to have a property definition like this one:

class User
{
    #[Assert\Email]
    #[Serializer\Groups(['list'])]
    public string $email;
}

With the aliased imports, you know where each of the attributes is coming from and what their purpose is (validation constraint, serialization group configuration, etc ...). If you take away the imports, there's a bit more ambiguity with each attribute:

class User
{
    #[Email]
    #[Groups(['list'])]
    public string $email;
}

Hope this helps explain why having aliases makes sense.
Keep up the awesome work with the drupal/coder!

🇨🇭Switzerland wengerk Lausanne

Here a patch you can apply

🇨🇭Switzerland wengerk Lausanne

@candelas it's a mistake of my own, sorry.

Bamboo Twig does not require twig/extensions anymore. All functions have been rewritten on 5.0.0

  • bamboo_extensions_shuffle that was named shuffle into twig/extensions
  • bamboo_extensions_time_diff that was named time_diff into twig/extensions
  • bamboo_extensions_truncate that was named truncate into twig/extensions

I will remove the install requirements which is misleading.

🇨🇭Switzerland wengerk Lausanne

Many Many thanks to all of you ! Has been merged on 6.0.x

🇨🇭Switzerland wengerk Lausanne

Many Many thanks @apaderno !!
Merged on 6.0.x

🇨🇭Switzerland wengerk Lausanne

Closed as duplicate of #3417105 ( https://www.drupal.org/project/bamboo_twig/issues/3417105 🐛 Unable to install bamboo_twig_extensions Active )

🇨🇭Switzerland wengerk Lausanne

Thx Apaderno ! I will take a look a it asap.

I'm concerned by the failing tests and open another issue to fix it, it's easy to fix but I currently don't have much time for open source

If you wanna help, you're welcome :)
https://www.drupal.org/project/bamboo_twig/issues/3417699 🐛 Tests failing on Drupal 10 because Tests module has same name as Test Theme Needs work

🇨🇭Switzerland wengerk Lausanne

I don't know if a better alternative exists, but I unfortunately don't have that much time to maintain this project and all other open-source library. And I (personally) don't use potion anymore in our project, therefore I'm not the best person to maintain a project I don't use anymore :/

Do you wish or plan to help maintain the project ?

🇨🇭Switzerland wengerk Lausanne

Already been fixes on https://www.drupal.org/project/editor_advanced_image/issues/3337628 📌 Not possible to uninstall ckeditor 4 in Drupal 10 Fixed

A patch already exists, I should release a newer version of thé module

🇨🇭Switzerland wengerk Lausanne

Thanks for your contribution ! Here are my comments before merging

  1. +++ b/CHANGELOG.md
    -- fix Issue #3318856 by solantoast: The 'core_version_requirement' constraint (^9) requires the 'core' key not be set
    +- fix Issue #3318856 by solantoast: The 'core_version_requirement'
    +constraint (^9) requires the 'core' key not be set
    

    Changelog should not be impcated by multiline changes please revert this

  2. +++ b/CONTRIBUTING.md
    @@ -33,30 +33,38 @@ on your environment:
    -    docker-compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
    +    docker-compose exec -u www-data drupal drush site-install standard
    +    --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
    

    if wanna break commande line in multiple lines, then use the leading \ in order to keep them working when copy/past

  3. +++ b/CONTRIBUTING.md
    @@ -33,30 +33,38 @@ on your environment:
    +We use the [Docker for Drupal Contrib images]
    +(https://hub.docker.com/r/wengerk/drupal-for-contrib) to run testing on our
    

    don't break link Markdown

  4. +++ b/CONTRIBUTING.md
    @@ -33,30 +33,38 @@ on your environment:
    +    docker-compose exec -u www-data drupal phpunit --group=timesup
    +    --no-coverage --stop-on-failure --configuration=/var/www/html/phpunit.xml
    

    keep commande line working by using leading \

  5. +++ b/CONTRIBUTING.md
    @@ -86,7 +97,8 @@ PHP_CodeSniffer is an essential development tool that ensures your code remains
    +  $ docker-compose exec drupal ./vendor/bin/phpcbf
    +  ./web/modules/contrib/timesup/
    

    keep commande line working with leading \

  6. +++ b/CONTRIBUTING.md
    @@ -96,8 +108,9 @@ https://github.com/phpmd/phpmd
    +  $ docker-compose exec drupal phpmd ./web/modules/contrib/timesup/
    +  text ./phpmd.xml \ --suffixes php,module,inc,install,test,profile,
    +  theme,css,info,txt --exclude *Test.php,*vendor/*
    

    missing leading \

  7. +++ b/CONTRIBUTING.md
    @@ -107,7 +120,11 @@ https://github.com/sebastianbergmann/phpcpd
    +  $ docker-compose exec drupal phpcpd ./web/modules/contrib/timesup/src
    +  --suffix .php --suffix .module --suffix .inc --suffix .install
    +  --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info
    +  --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests
    +  --exclude vendor/
    

    missing leading \ making the cli unworking when copy-pasta

  8. +++ b/CONTRIBUTING.md
    @@ -118,7 +135,8 @@ A scanner that checks compatibility of your code with PHP interpreter versions.
    +    --file-extensions php,module,inc,install,test,profile,theme,info
    +    --exclude vendor
    

    missing leading \ making the cli unworking when copy-pasta

🇨🇭Switzerland wengerk Lausanne

Thanks for your message.
I think it's a duplicate of an already addressed issue -> https://www.drupal.org/project/editor_advanced_image/issues/3337628 📌 Not possible to uninstall ckeditor 4 in Drupal 10 Fixed

The #3337628 suggest a patch until I release a new version for the module.

🇨🇭Switzerland wengerk Lausanne

fixed, thanks for having spotted this :)

🇨🇭Switzerland wengerk Lausanne

Here is a patch adding the new alt parameter on bamboo_render_image

Example of usage

{{ bamboo_render_image(1, 'thumbnail', 'Dignissim (...) primis') }}
🇨🇭Switzerland wengerk Lausanne

We should look at what Devel did with a phpcsxml dist file and ignore the 80 limit chars for markdown files

https://www.drupal.org/project/devel/issues/3133703

🇨🇭Switzerland wengerk Lausanne
+++ b/tests/src/Kernel/Loader/EntityBlockTest.php
@@ -0,0 +1,81 @@
+   * Cover the usage of {{ bamboo_render_entity('block_content', 1) }}.

Wrong comment here. Seems to cover bamboo_loader_entity instead

+++ b/tests/src/Kernel/Loader/EntityBlockTest.php
@@ -0,0 +1,81 @@
+   * Cover the usage of {{ bamboo_render_entity('block', 'stark_branding') }}.

Wrong comment here. Seems to cover bamboo_loader_entity instead

🇨🇭Switzerland wengerk Lausanne

Here is a patch that remove the ckeditor4 requirements on 2.x

You can still apply it on your own composer.json if needed.

🇨🇭Switzerland wengerk Lausanne

Hello Vincent,

If you only need to use CKEditor 5 on your project, then I suggest you to upgrade to the version 3.0 of NBSP.

The 2.2.x support both CKeditor 4 & CKeditor 5 - 3.x supports only CKEditor 5 and therefore remove the requirements for CKeditor 4.

🇨🇭Switzerland wengerk Lausanne

merged on f51fdd7 by removing both ck4 & ck5 hard dependency

🇨🇭Switzerland wengerk Lausanne

Here a version whitout both ck4 & ck5 to prevent any hard dependencies leading to unusable config export/import.

🇨🇭Switzerland wengerk Lausanne

Thanks for your contrib

1. on README.md and CONTRIBUTING.md, when breaking command line please add \ to keep it usable

Exemple:

-    docker-compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
+    docker-compose exec -u www-data drupal drush site-install standard \
+    --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
🇨🇭Switzerland wengerk Lausanne

Hello Miksan,

Thank you for your contribution to the "Potion" module. However, I regret to inform you that the "Potion" module has been discontinued and is no longer actively maintained. As a result, I cannot merge any new code into the module.

I appreciate your interest in contributing to the module, and I want to thank you for your efforts. If you or anyone else is interested in taking over the maintenance of the module, please let me know. I would be more than happy to transfer the ownership to someone who is willing to continue developing and supporting the module.

Thank you again for your contribution, and I hope to hear back from you soon.

🇨🇭Switzerland wengerk Lausanne

Dibix, thank you very much for all of your efforts, research on the matter, and providing a comprehensive summary of the issue with precise steps.

🇨🇭Switzerland wengerk Lausanne

Add both new functions added by  https://www.drupal.org/project/bamboo_twig/issues/3254160 🐛 Handle entity revision for Render and Loader Fixed

  • bamboo_render_entity_revision(entity_type, revision_id, view_mode, langcode)
  • bamboo_load_entity_revision(entity_type, revision_id, langcode)
🇨🇭Switzerland wengerk Lausanne

Why not enabling CKEditor 5 module, on your project ? And don't use it for now ? So you still have both CKeditor 4 & 5 and everything should be fine - noop ?

🇨🇭Switzerland wengerk Lausanne

The project is marked obsolet see https://www.drupal.org/project/potion/issues/3318091 💬 Why is the module marked obsolete and unsupported? Active

I will not merge or review any changes excepted for people willing to take the main maintainer role for the project.

🇨🇭Switzerland wengerk Lausanne

The module is not more necessary and I will not continue maintaining it.

Still if somebody want to maintain it I'm open to onboard it on the project to continue it

🇨🇭Switzerland wengerk Lausanne

Added tests and merged on 6.0.x

Production build 0.71.5 2024