Account created on 8 October 2010, over 14 years ago
#

Merge Requests

More

Recent comments

🇮🇱Israel jsacksick

This was already fixed as part of 📌 Remove translation and capitalization from the category annotation Active and should be in the latest release?
Wait which Commerce version are you using?

Actually you're reverting the fix? Probably an incompatibility between the Commerce version you're using and Commerce Product Tax.

🇮🇱Israel jsacksick

Ok the way this should be handled is like the following to support earlier versions of Drupal:

  $constraint_definitions = $this->constraintManager->getDefinitions();
    if (isset($constraint_definitions['FileExtension'])) {
      $form['csv']['#upload_validators'] = [
        'FileExtension' => ['extensions' => 'csv'],
      ];
    }
    else {
      $form['csv']['#upload_validators'] = [
        'file_validate_extensions' => ['csv'],
      ];
    }

🇮🇱Israel jsacksick

Ok removing the extra properties from the AdjustmentItem failed... But removing the AdjustmentPropertyDefinition worked... Wondering why it was added in the first place?

🇮🇱Israel jsacksick

Do we actually need to declare each individual property like the following? The normalizer is on the value property, isn't that sufficient?
The normalization still works without those... Or is that needed for setting adjustments though the API?

$properties['type'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Type'))
      ->setComputed(TRUE);

    $properties['label'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Label'))
      ->setComputed(TRUE);

    $properties['amount'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Amount'))
      ->setComputed(TRUE);

    $properties['source_id'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Source ID'))
      ->setComputed(TRUE);

    $properties['percentage'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Amount'))
      ->setComputed(TRUE);

    $properties['included'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Included'))
      ->setComputed(TRUE);

    $properties['locked'] = DataDefinition::create('adjustment_property')
      ->setLabel(t('Locked'))
      ->setComputed(TRUE);

Isn't it

🇮🇱Israel jsacksick

Also let's not introduce the new methods in Product and ProductVariation and focus on the initial issue solved.
I'm still not convinced by the approach as ideally we should also rewrite the logic that fixes the backreference to the product from the variation.

This logic isn't problematic when you're referencing a small number of variations but starting from 50 variations (which isn't that high, saving a product would become awfully slow)... And crash if the number is higher.

🇮🇱Israel jsacksick

I am getting error: Undefined method: getVariationTypeId()

This is because the PR is against Commerce 2, the method was removed in Commerce 3, the patch needs to be rerolled.

🇮🇱Israel jsacksick

Attaching a static patch for use with composer.

🇮🇱Israel jsacksick

Attaching a static patch for use with Composer.

🇮🇱Israel jsacksick

+1: would be great to have a new release containing the PHP 8.4 deprecation fix.

🇮🇱Israel jsacksick

+1 on tagging a new release. PHP 8.4 has been released in November 2024 already.
Attaching a patch for use with Composer..

🇮🇱Israel jsacksick

Already fixed as part of 📌 PHP 8.4: Implicitly nullable parameter declarations deprecated Active but unfortunately not released, would be great to tag a new release.

🇮🇱Israel jsacksick

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

🇮🇱Israel jsacksick

Also this doesn't look right:

    $config = [
      'mode' => $this->configuration['mode'] ?? '+aCJK',
      'format' => $this->configuration['format'] ?? $format,
      'autoScriptToLang' => $this->configuration['autoScriptToLang'] ?? TRUE,
      'autoLangToFont' => $this->configuration['autoLangToFont'] ?? TRUE,
      'tempDir' => \Drupal::service('file_system')->getTempDirectory(),
      'default_font_size' => $this->configuration['default_font_size'] ?? 0,
      'default_font' => $this->configuration['default_font'] ?? '',
      'orientation' => $this->configuration['default_paper_orientation'] ?? static::PORTRAIT,
    ];

    $config += $this->configuration;

Shouldn't we leverage the default configuration here?
Also the use of \Drupal::service() isn't recommended, we should be using dependency injections here.

🇮🇱Israel jsacksick

Don't really have time to personally test this, but I'm willing to commit this considering this was RTBCED... However, aren't we missing changes to the composer.json? So that the mpdf library is populated?

Shouldn't we require mpdf/mpdf?

🇮🇱Israel jsacksick

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

🇮🇱Israel jsacksick

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

🇮🇱Israel jsacksick

Attaching a static patch to use for 2.x.

🇮🇱Israel jsacksick

Can we get new releases tagged? I actually didn't see this and created 🐛 Fix implicit nullables for PHP 8.4 Active . It's been a while and neither the latest 2.x or 3.x release have these fixes in.

🇮🇱Israel jsacksick

Shoot... Realized this was already fixed as part of 🐛 Deprecations PHP 8.4 Active but not yet part of a tagged release...

🇮🇱Israel jsacksick

I'm fine with validating all the fields just like the patch is doing atm.

🇮🇱Israel jsacksick

I also see that the MR was closed, is this not relevant anymore?

🇮🇱Israel jsacksick

Out of curiosity, why are you passing a quantity of 0? What is the use case for that? I'm just trying to understand how that is happening?

🇮🇱Israel jsacksick

Marking this as fixed, as we've been supporting D10 for long.

🇮🇱Israel jsacksick

I'm now using the CommerceContentEntityStorageSchema to allow specifying indexes straight from the entity type definition.

🇮🇱Israel jsacksick

@cslevy: I don't understand, is the patch from #4 or #5 the correct one? The patch from #5 is the same as #3 and the MR right?
If this fixes issues, I'm willing to commit the patch as is.

🇮🇱Israel jsacksick

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

🇮🇱Israel jsacksick

I fixed this and tagged a new release, updating to 2.2 should fix this.

🇮🇱Israel jsacksick

Yes indeed, probably should have prioritized this whenever I worked on tagging a stable release. However I don't think I'm going to have time to work on this this week at the very least...

🇮🇱Israel jsacksick

Hm, your patch isn't the correct one... Was probably optimistic to make these changes as I didn't realize this would imply forcing requiring Commerce 3.

Will fix this.

🇮🇱Israel jsacksick

It's probably best if you install it to get more familiar with what the module can or cannot do.

🇮🇱Israel jsacksick

Nope, there is no way to add new emails from the UI today.
We could potentially leverage Commerce email and add support for that though. That would actually be a nice addition.

🇮🇱Israel jsacksick

hm... I guess this approach is ok though we could probably copy what the EditQuantity views field handler is doing:

$violations = $order_item
        ->validate()
        ->filterByFields(array_diff(array_keys($order_item->getFieldDefinitions()), [
          'purchased_entity',
          'quantity',
        ]));

This way we flag only errors for the purchased entity field and the quantity... Thoughts?

🇮🇱Israel jsacksick

There is a "Resend confirmation" action from the invoice view page, as well as an operation on the invoices list.

🇮🇱Israel jsacksick

I just don't see what needs to be answered here. The initial report is from 2012, and isn't relevant to how the module is currently working?

Rules is mentioned and that is a Drupal 7 thing for example... Just not sure there is anything actionable here.

🇮🇱Israel jsacksick

How would you describe this use case?

Let's say a customer didn't receive the email as expected (was sent to spam or the email service was temporarily offline, having a way to resend the invoice allows to address that.
Similarly to the "Resend receipt" operation we have for orders.

🇮🇱Israel jsacksick

@afagioli: Why did you reopen a 7.x feature request? 7.x is dead.

🇮🇱Israel jsacksick

Ok, here's a first attempt at this... This would deserve new tests, but don't really have the time to write them atm...

🇮🇱Israel jsacksick

My concern from #3 is still valid so I wonder how we could mitigate that... I don't think looping over invoices is an acceptable solution for sites with a large number of invoices... And I don't think this is desirable either.

Maybe we add a descriptive text explaining the potential issues when updating the directory?

🇮🇱Israel jsacksick

Also note that this report is probably a bit confusing as we are actually checking if the invoice file exists before generating an invoice already.

The suggested solution implies the invoice is generated from the admin which is most likely not the case for 90% of the merchants.
Not really sure how to properly address that.

The fact that we make sure to not regenerate an invoice file everytime is for compliance / immutability reasons... To make sure the invoice content isn't different if regenerated / resent a second time.

With that said, using the invoice UUID instead of the invoice number in the filename could help mitigating that.
I just wonder if this is an acceptable solution and would not be considered a breaking change.

🇮🇱Israel jsacksick

Closing this as a duplicate of Provide a resend confirmation action link for invoices Active which implemented a different approach. Feel free to reopen this if you believe there is still a gap and the need is not properly addressed.

🇮🇱Israel jsacksick

The scope expanded... I'm hoping I'm not making a mistake by overridding the label() method but I think this change makes sense and is kind of similar to what was done for orders (although we don't use the type there).

🇮🇱Israel jsacksick

Could you please explain how to completely delete the invoice entity?

Deleting the invoices from the file system should do the trick, have you tried that?

🇮🇱Israel jsacksick

Note that I'm altering the label() method to have consistent labels accross the UI.

🇮🇱Israel jsacksick

Attached a screenshot of what the action link looks like. Note that I added a "Download" action link as well.

🇮🇱Israel jsacksick

hm... Why not though I think we should have a "Resend" operation from the invoices list (similar to "Pay" and "Download") for consistency.
So I think the patch should be updated to add this for invoices instead of the order... Though having it for orders could also be valid, but I'm just voting for consistency here...

🇮🇱Israel jsacksick

This introduces a breaking change, but I don't think we have a choice here (besides introducing a new method with a different name doing the same thing)...

🇮🇱Israel jsacksick

Ok I made the change anyway, opened an MR, let's see if the tests are passing.

🇮🇱Israel jsacksick

Confirmed the fix locally myself, merged!

Production build 0.71.5 2024