Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Well, based on the title, I guess that is expected. But for example the price "4 000" I would expect I could import. However, this is currently not the case.
The price "one hundred eirik dollars" should probably not be allowed to import ;)
However, if one decides to import such a price, it should not crash the other prices we are trying to import. Super annoying if price number 80000 crashes the import, and you have to start over.
Comment | File | Size | Author |
---|---|---|---|
#10 | commerce_pricelist-3087390-10.patch | 6.54 KB | jsacksick |
| |||
#10 | interdiff_9-10.txt | 411 bytes | jsacksick |
#9 | commerce_pricelist-3087390-9.patch | 6.54 KB | jsacksick |
| |||
#6 | 3087390-6.patch | 4.84 KB | eiriksm |
| |||
#2 | 3087390-test-only.patch | 3.06 KB | eiriksm |
Comments
Comment #2
eiriksmComment #3
eiriksmSo basically this fixes three issues in one:
- Make it possible to import prices with a space in them
- Make sure the import does not crash if a price is invalid in one of the rows
- Make sure the import does not crash (but rather skip the list price) on invalid list price fields.
I could make separate issues for all of them, but it was convenient for me.
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedI don't think the if is necessary, and we should probably do that for the list price as well no?
Comment #6
eiriksmGood point!
Updated patch
Comment #7
jsacksick CreditAttribution: jsacksick at Centarro commentedSorry for the late feedback, we already have functional tests for the import, and these are in PriceListItemTest, not PriceListTest.
Could you actually add a method there? (We already have testImportPriceListItemsWithDelete and testImportPriceListItemsWithUpdate).
Comment #8
jsacksick CreditAttribution: jsacksick at Centarro commentedThe patch needs to be rerolled now that #3095942: Move the row for building the CSV header & rows to helper methods was committed.
Comment #9
jsacksick CreditAttribution: jsacksick at Centarro commentedOk, I moved the test to PriceListItemTest, and refactored it a little, tests are passing for me locally.
Comment #10
jsacksick CreditAttribution: jsacksick at Centarro commentedRemoving the empty useless line in the CSV file.
Comment #12
jsacksick CreditAttribution: jsacksick at Centarro commentedTests are passing, committed!