Account created on 15 September 2009, over 15 years ago
#

Merge Requests

More

Recent comments

🇨🇭Switzerland Lukas von Blarer

I see the cahnces of someone being affected by the BC very low. But I want to communicate them. Should I do that in the relese notes of the next release?

🇨🇭Switzerland Lukas von Blarer

The patch works in some cases, but I have the same issues as described in #132

🇨🇭Switzerland Lukas von Blarer

What's the status here can we get this commited?

🇨🇭Switzerland Lukas von Blarer

For anyone looking for a solution to the issues with the translation of rates and labels of the plugin, please refer to the follow-up here: Make shipping plugin fields translations configurable independently Active

🇨🇭Switzerland Lukas von Blarer

The operators didn't work for me either. I ended up trying to write a custom condition that negates the default one commerce provides. Which turned out to be very easy:

<?php

namespace Drupal\MODULE\Plugin\Commerce\Condition;

use Drupal\commerce_product\Plugin\Commerce\Condition\OrderItemProductCategory;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;

/**
 * Provides the product category negated condition for order items.
 *
 * @CommerceCondition(
 *   id = "order_item_product_category_negated",
 *   label = @Translation("Product category negated"),
 *   display_label = @Translation("Product categories negated"),
 *   category = @Translation("Products"),
 *   entity_type = "commerce_order_item",
 * )
 */
class OrderItemProductCategoryNegated extends OrderItemProductCategory implements ContainerFactoryPluginInterface {
  /**
   * {@inheritdoc}
   */
  public function evaluate(EntityInterface $entity) {
    return !parent::evaluate($entity);
  }

}

Maybe we could even use that for this issue?

🇨🇭Switzerland Lukas von Blarer

Ok, the last commit adds a lazy builder. This improved performance a lot.

🇨🇭Switzerland Lukas von Blarer

Updating the wishlist block via ajax was accidentally removed in this MR. I just added it back.

Besides that the MR work perfectly for me.

🇨🇭Switzerland Lukas von Blarer

I added another MR that provides compatibility with Option to proivde remove links Active because the two MRs play nicely together. It simply updates the add to wishlist links.

@anas_maw You can send messages using MessageCommand. It works, but I guess there must be a better way to collect and display messages in ajax command than this:

$messages = \Drupal::messenger()->messagesByType('status');
foreach ($messages as $message) {
  $response->addCommand(new MessageCommand($message));
}
\Drupal::messenger()->deleteByType('status');

But as it is this just adds a message to the top of the page for me and doesn't really help the user to understand what happened.

🇨🇭Switzerland Lukas von Blarer

I implemented a new cache context. I don't have a lot of experience with caching, so probably this could be solved in a better performing way. My approach potentially creates a lot of cache data. I'd happy to get a review on this.

I'm trying to look into the lazy builder, since that'd probably improve performance a lot.

🇨🇭Switzerland Lukas von Blarer

Ok, now a remove link is being displayed if any (not the default) product variation is in the wishlist.

🇨🇭Switzerland Lukas von Blarer

Ok, I guess this is why the cache context isn't working:

https://git.drupalcode.org/project/commerce_wishlist/-/blob/8.x-3.x/src/...

public function getContext() {
  return implode(':', $this->wishlistProvider->getWishlistIds($this->account));
}

I guess that we'd need a new context that takes into all wishlist items into account. WishlistCacheContext only takes wishlist entites into account.

🇨🇭Switzerland Lukas von Blarer

@anas_maw Thank you for your feedback!

Yeah, I found the caching issue as well. But your approach simply disables caching altogether. I think we could do better.

I tried to use the wishlist cache context. This improves the situation, but doesn't solve it completely. The cache somehow doesn't vary when a product is added to the wishlist. Any ideas how to solve that? Do we need a different context?

Additionally we might want to use a lazy builder to improve performance.

🇨🇭Switzerland Lukas von Blarer

luksak changed the visibility of the branch 3481746-option-to-proivde to hidden.

🇨🇭Switzerland Lukas von Blarer

I needed this for wishlist links as well and updated the MR with it. It works quite well for me.

Shouldn't we try to use a data-attribute selector for the count? The approach with the class won't work for most sites... But yeah, that'd require commerce and commerce_wishlist to change the templates. Alternatively we could make the selector configurable? Or we'd need to let users know that the functionality depends on that selector and that users should add it to their templates in case they want it to work.

But at least the limitation of using a <span> for the count could be resolved.

Any other takes on this?

🇨🇭Switzerland Lukas von Blarer

I took a first stab at this.

There is an incompatibility with commerce_stock_enforcement. There are errors when clicking one of the actions in the success dialog. The happen because the form state is missing, but we're still extending the AddToCartForm. Here is the error:

TypeError: commerce_stock_enforcement_get_context(): Argument #1 ($entity) must be of type Drupal\commerce\PurchasableEntityInterface, null given, called in /app/web/modules/contrib/commerce_stock/modules/enforcement/commerce_stock_enforcement.module on line 160 in commerce_stock_enforcement_get_context() (line 317 of modules/contrib/commerce_stock/modules/enforcement/commerce_stock_enforcement.module).

So I tried to still call parent::buildForm(), but hide the elements. That works for me so far.

I haven't looked into the "Out of stock" button behaviour of commerce_stock so far. I'm using a quite customized add to cart form.

🇨🇭Switzerland Lukas von Blarer

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

🇨🇭Switzerland Lukas von Blarer

Ok, got it. Since I don't plan to fix this: Feel free to create an MR. I'm happy to review.

🇨🇭Switzerland Lukas von Blarer

Closing this, since this works as designed.

🇨🇭Switzerland Lukas von Blarer

Looks good to me. Please open issues in case you experience bugs with Drupal 11.

🇨🇭Switzerland Lukas von Blarer

Actually... Shouldn't this go into config translation? The current solution uses string translation.

🇨🇭Switzerland Lukas von Blarer

Thank you, merged the MR.

🇨🇭Switzerland Lukas von Blarer

I'm sorry, The cause of my errors was something else. Still, this should be fixed I guess.

🇨🇭Switzerland Lukas von Blarer

I needed a quick fix and simpy made all mentioned parameters required. This fixes the requests for me. But this probably should be fixed differently.

🇨🇭Switzerland Lukas von Blarer

The module does provide this option. You can find it at /admin/config/services/simplenews/settings/subscription. The is a checkbox with the label "Skip email verification (discouraged)".

🇨🇭Switzerland Lukas von Blarer

I was quite confused by this. I think the simplenews 4.x release took the wrong path here... This is a very unintuitive API. And in my opinion very prone to errors. Take a look at this:

<?php
  /**
   * Checks if subscriber confirmation should be skipped.
   *
   * @return bool
   *   TRUE if confirmation should be skipped.
   */
  public static function skipConfirmation() {
    // Skip if logged in or if configured to skip.
    return \Drupal::currentUser()->id() || \Drupal::config('simplenews.settings')->get('subscription.skip_verification');
  }
?>

Any logged in user can skip confirmation to subscribe any email address. And this is on an API level.

🇨🇭Switzerland Lukas von Blarer

Ok, found the issue. I chose the wrong name in the schema.

The fieldsets are being exposed properly for me.

🇨🇭Switzerland Lukas von Blarer

I took a look at this. I think it is almost done, but somehow there is something missing. I get this error when visiting the explorer:

GraphQL\Error\Error: Type "WebformElementWebformFieldset" not found in document. in GraphQL\Utils\BuildSchema::GraphQL\Utils\{closure}() (line 149 of /app/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php).

GraphQL\Utils\ASTDefinitionBuilder->internalBuildType() (Line: 190)
GraphQL\Utils\ASTDefinitionBuilder->buildType() (Line: 193)
GraphQL\Utils\BuildSchema::GraphQL\Utils\{closure}() (Line: 350)
GraphQL\Type\Schema->loadType() (Line: 326)
GraphQL\Type\Schema->getType() (Line: 548)
GraphQL\Utils\SchemaExtender::extend() (Line: 356)
Drupal\graphql_core_schema\Plugin\GraphQL\Schema\CoreComposableSchema->getFullSchemaDocumentOverride() (Line: 314)
Drupal\graphql_core_schema\Plugin\GraphQL\Schema\CoreComposableSchema->getSchema() (Line: 253)
Drupal\graphql\Entity\Server->configuration() (Line: 199)
Drupal\graphql\Entity\Server->executeOperation() (Line: 27)
Drupal\graphql\GraphQL\Utility\Introspection->introspect() (Line: 87)
Drupal\graphql\Controller\ExplorerController->viewExplorer()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)
🇨🇭Switzerland Lukas von Blarer

The MR works for me with simplenews 4.x.

🇨🇭Switzerland Lukas von Blarer

Ok, that makes sense. No, I have no idea how to approach this.

Do you know a workaround for the issue I described though?

🇨🇭Switzerland Lukas von Blarer

Ok, this works as designed. This is the solution to this problem: 🐛 Views - Anonymous User Fixed

I was able to make the code a bit more generic:

/**
 * Implements hook_ENTITY_TYPE_access().
 */
function HOOK_view_access(View $view, $operation, $account) {
  $route_name = \Drupal::routeMatch()->getRouteName();
  if ($operation === 'view' && str_starts_with($route_name, 'graphql.query')) {
    return AccessResult::allowedIf($view->getExecutable()->access('default', $account));
  }
  return AccessResult::neutral();
}

Maybe that should be documented in the docs here? https://graphql-core-schema.netlify.app/schema-extensions/views.html That's at least where I was looking for why this isn't working.

🇨🇭Switzerland Lukas von Blarer

I'm having this issue as well. @Siegrist have you found a solution to this?

🇨🇭Switzerland Lukas von Blarer

I think this doesn't solve the issue entirely. If I understand your approach correctly, this solves the incorrect order for non-company addresses. But the issue where the order is mixed up compared to the user input persists for company addresses. Is there a way to solve that too?

🇨🇭Switzerland Lukas von Blarer

Oh, I just realized that using prefixes is the way the blacklist of purge_queuer_coretags works already. I don't think that that is optimal, since that gives us less flexibility, but I guess that's is another issue. Please ignore the patch in #13.

🇨🇭Switzerland Lukas von Blarer

This one only checks for exact matches. But I didn't fix anything else. So just ignore this patch in case you don't need that.

🇨🇭Switzerland Lukas von Blarer

Attached you can find a re-roll.

🇨🇭Switzerland Lukas von Blarer

In my case I need exact matches. I want to blacklist node_list, but that would also match node_list:article, which is not what I want.

🇨🇭Switzerland Lukas von Blarer

Right now I can't do a full review of the MR. Is there a way to get a diff of my module? That way I could reply to changes.

🇨🇭Switzerland Lukas von Blarer

Hi there! Thank you for reaching out to me!

All fine for me that you ported my code here. Please make sure that I receive commit authorship for it. And I'd like to declare the sponsorship for it on the project page.

🇨🇭Switzerland Lukas von Blarer

The current MR worked perfectly for a field formatter in a view. Thank you!

🇨🇭Switzerland Lukas von Blarer

Sorry, probably that needs a better review ;)

🇨🇭Switzerland Lukas von Blarer

This works like a charm! Thank you!

I think that for the specific use case of having an array with values this is the simpler and better solution than the approach of Add wrapper process plugin to wrap/unwrap values in arrays Needs review .

🇨🇭Switzerland Lukas von Blarer

Sorry, I forgot to add the new files.

🇨🇭Switzerland Lukas von Blarer

I fixed an issue where the duration is wrong in case the entries don't lass full hours, but fractions such as 1 hour and 30 minutes.

🇨🇭Switzerland Lukas von Blarer

I just had another failing webhook for a different order with the same error.

I don't allow users to set a timezone for their account. Insystem.date the timezone.user.configurable is set to false.

I'm having trouble finding out which order the failing webhook belongs to in the wallee backend. Because of that I can't provide more information about the failing order. Do you know how to associate a webhook with a payment transaction in wallee?

🇨🇭Switzerland Lukas von Blarer

I'm currently testing this patch. One thing that would be really nice is handling of overlapping items in the calendar. Currently they simply sit on top of each other and can completely cover each other.

🇨🇭Switzerland Lukas von Blarer

This doens't work for me yet. Exception days still have no effect on the 'Current day' formatter.

Production build 0.71.5 2024