- Issue created by @oadaeh
- Issue was unassigned.
- πΊπΈUnited States oadaeh
Also, this patch makes this module compatible with Drupal 10.
- Status changed to Needs work
about 1 year ago 8:48pm 29 September 2023 - πΊπΈUnited States zengenuity
This looks good. Thanks for your work on this. The only thing I would like you to change is can you put your code in the existing Packer class rather than making a new PackagePacker class?
On the site where I've used this module, I've extended the Packer class to add some client-specific logic. Since your class is different, I wasn't getting your updates automatically until I changed my custom class to subclass your new one. That seems unnecessary since your new code should be compatible with what we were doing before.
Otherwise, this seems to work great in my testing.
- πΊπΈUnited States oadaeh
Shoot! The PackagePacker class was supposed to replace the Packer class, not add to it.
I kept getting "PHP Fatal error: Cannot declare class Drupal\commerce_shipping_boxpacker\Packer\Packer because the name is already in use in /web/modules/contrib/commerce_shipping_boxpacker/src/Packer/Packer.php" until I renamed it. - πΊπΈUnited States oadaeh
I figured it out. By adding the the library's Packer class in a use statement, I created a name conflict, so I removed the use statement and directly specified the class where necessary.
- πΊπΈUnited States zengenuity
Thanks! This looks good, but the new patch doesn't include the max weight per package feature. Can you either add that back in here or make another patch on β¨ Implement configurable max weight per package Active ? That part was good and I don't want to lose it.
- Status changed to Needs review
about 1 year ago 8:42pm 2 October 2023 - πΊπΈUnited States oadaeh
The functionality is still there.
The new `commerce_shipping_boxpacker.module` file is there.
The new `config/schema/commerce_shipping_boxpacker.schema.yml` file is there.
The additional $max_weight code in `src/Packer/Packer.php` is there.Is it not working for you?
I'm also attaching an interdiff, which I should have done previously.
-
zengenuity β
committed dc9a05d8 on 1.0.x authored by
oadaeh β
Issue #3390721 by oadaeh: Improve Packer class
-
zengenuity β
committed dc9a05d8 on 1.0.x authored by
oadaeh β
- Status changed to Fixed
about 1 year ago 1:16pm 3 October 2023 - πΊπΈUnited States zengenuity
Sorry. You're right. It's there. I must have made a mistake when I tested the second patch.
I just committed the patch, and I'm going to create a new release now. Thanks so much for your work on this!
- πΊπΈUnited States scottsawyer Atlanta
FYI, I think you can avoid the name conflicts by changing:
use DVDoug\BoxPacker\Packer;
to
use DVDoug\BoxPacker\Packer as BoxPacker;
- πΊπΈUnited States oadaeh
Oh, yes, that should work. I totally forgot about it. Thanks for the reminder.
Automatically closed - issue fixed for 2 weeks with no activity.