verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

Rebuilding Project Config Disabled Shipping #41

Closed simeon-smith closed 3 years ago

simeon-smith commented 3 years ago

Description When you rebuild the craft project config the settings for which shipping providers and methods are enabled get disabled.

Steps to reproduce

  1. Setup a project with the craft project config.
  2. Enable some settings.
  3. Rebuild the project config.

Additional info

Additional context

simeon-smith commented 3 years ago

Also, it appears that sometimes the project config is being written in a flat format without indentations.

engram-design commented 3 years ago

So that, odd. Postie's settings are stored in the plugin settings, not a separate config key, so it should be pretty well foolproof, and core Craft behaviour.

What's more, I can't seem to produce this, see this screenshot after a rebuild: https://d.pr/i/EoTtIx

simeon-smith commented 3 years ago

@engram-design

So this has actually happened to me 2 different times. It may not be specifically related to rebuild.

This is what my config looked like when it got messed up one of the times. The rebuild switched all true '1' to empty strings.

  postie:
    edition: standard
    enabled: true
    schemaVersion: 2.0.0
    settings:
      displayDebug: true
      displayErrors: true
      enableCaching: true
      fetchRatesPostValue: postie-fetch-rates
      hasCpSection: '1'
      manualFetchRates: true
      pluginName: Postie
      providers:
        __assoc__:
          - '- australiaPost - __assoc__: - - name - "Australia Post" - - enabled - "" - - settings - __assoc__: - - apiKey - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - AUS_PARCEL_COURIER - __assoc__: - - name - "AusPost Domestic Courier Post" - - enabled - "" - - AUS_PARCEL_COURIER_SATCHEL_MEDIUM - __assoc__: - - name - "AusPost Domestic Courier Post Assessed Medium Satchel" - - enabled - "" - - AUS_PARCEL_EXPRESS - __assoc__: - - name - "AusPost Domestic Express Post" - - enabled - "" - - AUS_PARCEL_EXPRESS_SATCHEL_500G - __assoc__: - - name - "AusPost Domestic Express Post Small Satchel" - - enabled - "" - - AUS_PARCEL_REGULAR - __assoc__: - - name - "AusPost Domestic Parcel Post" - - enabled - "" - - AUS_PARCEL_REGULAR_SATCHEL_500G - __assoc__: - - name - "AusPost Domestic Parcel Post Small Satchel" - - enabled - "" - - INT_PARCEL_COR_OWN_PACKAGING - __assoc__: - - name - "AusPost International Courier" - - enabled - "" - - INT_PARCEL_EXP_OWN_PACKAGING - __assoc__: - - name - "AusPost International Express" - - enabled - "" - - INT_PARCEL_STD_OWN_PACKAGING - __assoc__: - - name - "AusPost International Standard" - - enabled - "" - - INT_PARCEL_AIR_OWN_PACKAGING - __assoc__: - - name - "AusPost International Economy Air" - - enabled - "" - - INT_PARCEL_SEA_OWN_PACKAGING - __assoc__: - - name - "AusPost International Economy Sea" - - enabled - ""'
          - '- canadaPost - __assoc__: - - name - "Canada Post" - - enabled - "" - - settings - __assoc__: - - customerNumber - "" - - username - "" - - password - "" - - useTestEndpoint - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - DOM_EP - __assoc__: - - name - "Expedited Parcel" - - enabled - "" - - DOM_RP - __assoc__: - - name - "Regular Parcel" - - enabled - "" - - DOM_PC - __assoc__: - - name - Priority - - enabled - "" - - DOM_XP - __assoc__: - - name - Xpresspost - - enabled - "" - - INT_PW_ENV - __assoc__: - - name - "Priority Worldwide envelope INTL" - - enabled - "" - - USA_PW_ENV - __assoc__: - - name - "Priority Worldwide envelope USA" - - enabled - "" - - USA_PW_PAK - __assoc__: - - name - "Priority Worldwide pak USA" - - enabled - "" - - INT_PW_PAK - __assoc__: - - name - "Priority Worldwide pak INTL" - - enabled - "" - - INT_PW_PARCEL - __assoc__: - - name - "Priority Worldwide parcel INTL" - - enabled - "" - - USA_PW_PARCEL - __assoc__: - - name - "Priority Worldwide parcel USA" - - enabled - "" - - INT_XP - __assoc__: - - name - "Xpresspost International" - - enabled - "" - - INT_IP_AIR - __assoc__: - - name - "International Parcel Air" - - enabled - "" - - INT_IP_SURF - __assoc__: - - name - "International Parcel Surface" - - enabled - "" - - INT_TP - __assoc__: - - name - "Tracked Packet - International" - - enabled - "" - - INT_SP_SURF - __assoc__: - - name - "Small Packet International Surface" - - enabled - "" - - INT_SP_AIR - __assoc__: - - name - "Small Packet International Air" - - enabled - "" - - USA_XP - __assoc__: - - name - "Xpresspost USA" - - enabled - "" - - USA_EP - __assoc__: - - name - "Expedited Parcel USA" - - enabled - "" - - USA_TP - __assoc__: - - name - "Tracked Packet - USA" - - enabled - "" - - USA_SP_AIR - __assoc__: - - name - "Small Packet USA Air" - - enabled - ""'
          - '- fastway - __assoc__: - - name - Fastway - - enabled - "" - - settings - __assoc__: - - apiKey - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - RED - __assoc__: - - name - "Road Parcel (Red)" - - enabled - "" - - GREEN - __assoc__: - - name - "Road Parcel (Green)" - - enabled - "" - - BROWN - __assoc__: - - name - "Local Parcel (Brown)" - - enabled - "" - - BLACK - __assoc__: - - name - "Local Parcel (Black)" - - enabled - "" - - BLUE - __assoc__: - - name - "Local Parcel (Blue)" - - enabled - "" - - YELLOW - __assoc__: - - name - "Local Parcel (Yellow)" - - enabled - "" - - PINK - __assoc__: - - name - "Shorthaul Parcel (Pink)" - - enabled - "" - - SAT_NAT_A2 - __assoc__: - - name - "National Network A2 Satchel" - - enabled - "" - - SAT_NAT_A3 - __assoc__: - - name - "National Network A3 Satchel" - - enabled - "" - - SAT_NAT_A4 - __assoc__: - - name - "National Network A4 Satchel" - - enabled - "" - - SAT_NAT_A5 - __assoc__: - - name - "National Network A5 Satchel" - - enabled - ""'
          - '- fedEx - __assoc__: - - name - FedEx - - enabled - "" - - settings - __assoc__: - - accountNumber - "" - - meterNumber - "" - - key - "" - - password - "" - - useTestEndpoint - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - FEDEX_1_DAY_FREIGHT - __assoc__: - - name - "FedEx Domestic 1 Day Freight" - - enabled - "" - - FEDEX_2_DAY - __assoc__: - - name - "FedEx Domestic 2 Day" - - enabled - "" - - FEDEX_2_DAY_AM - __assoc__: - - name - "FedEx Domestic 2 Day AM" - - enabled - "" - - FEDEX_2_DAY_FREIGHT - __assoc__: - - name - "FedEx Domestic 2 DAY Freight" - - enabled - "" - - FEDEX_3_DAY_FREIGHT - __assoc__: - - name - "FedEx Domestic 3 Day Freight" - - enabled - "" - - FEDEX_EXPRESS_SAVER - __assoc__: - - name - "FedEx Domestic Express Saver" - - enabled - "" - - FEDEX_FIRST_FREIGHT - __assoc__: - - name - "FedEx Domestic First Freight" - - enabled - "" - - FEDEX_FREIGHT_ECONOMY - __assoc__: - - name - "FedEx Domestic Freight Economy" - - enabled - "" - - FEDEX_FREIGHT_PRIORITY - __assoc__: - - name - "FedEx Domestic Freight Priority" - - enabled - "" - - FEDEX_GROUND - __assoc__: - - name - "FedEx Domestic Ground" - - enabled - "" - - FIRST_OVERNIGHT - __assoc__: - - name - "FedEx Domestic First Overnight" - - enabled - "" - - PRIORITY_OVERNIGHT - __assoc__: - - name - "FedEx Domestic Priority Overnight" - - enabled - "" - - STANDARD_OVERNIGHT - __assoc__: - - name - "FedEx Domestic Standard Overnight" - - enabled - "" - - GROUND_HOME_DELIVERY - __assoc__: - - name - "FedEx Domestic Ground Home Delivery" - - enabled - "" - - SMART_POST - __assoc__: - - name - "FedEx Domestic Smart Post" - - enabled - "" - - INTERNATIONAL_ECONOMY - __assoc__: - - name - "FedEx International Economy" - - enabled - "" - - INTERNATIONAL_ECONOMY_FREIGHT - __assoc__: - - name - "FedEx International Economy Freight" - - enabled - "" - - INTERNATIONAL_FIRST - __assoc__: - - name - "FedEx International First" - - enabled - "" - - INTERNATIONAL_PRIORITY - __assoc__: - - name - "FedEx International Priority" - - enabled - "" - - INTERNATIONAL_PRIORITY_FREIGHT - __assoc__: - - name - "FedEx International Priority Freight" - - enabled - "" - - EUROPE_FIRST_INTERNATIONAL_PRIORITY - __assoc__: - - name - "FedEx Europe First International Priority" - - enabled - ""'
          - '- tntAustralia - __assoc__: - - name - "TNT Australia" - - enabled - "" - - settings - __assoc__: - - accountNumber - "" - - username - "" - - password - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - EX10 - __assoc__: - - name - "10:00 Express" - - enabled - "" - - EX12 - __assoc__: - - name - "12:00 Express" - - enabled - "" - - 712 - __assoc__: - - name - "9:00 Express" - - enabled - "" - - 717 - __assoc__: - - name - "Sensitive Express" - - enabled - "" - - 717B - __assoc__: - - name - "Sensitive Express" - - enabled - "" - - 73 - __assoc__: - - name - "Overnight PAYU Satchel" - - enabled - "" - - 75 - __assoc__: - - name - "Overnight Express" - - enabled - "" - - 76 - __assoc__: - - name - "Road Express" - - enabled - "" - - 718 - __assoc__: - - name - "Fashion Express" - - enabled - "" - - 701 - __assoc__: - - name - "National Same day" - - enabled - ""'
          - '- ups - __assoc__: - - name - UPS - - enabled - "1" - - settings - __assoc__: - - apiKey - - - testApiKey - - - username - - - password - - - accountNumber - "" - - negotiatedRates - "" - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - S_AIR_1DAYEARLYAM - __assoc__: - - name - "UPS Next Day Air Early AM" - - enabled - "" - - S_AIR_1DAY - __assoc__: - - name - "UPS Next Day Air" - - enabled - "1" - - S_AIR_1DAYSAVER - __assoc__: - - name - "Next Day Air Saver" - - enabled - "" - - S_AIR_2DAYAM - __assoc__: - - name - "UPS Second Day Air AM" - - enabled - "" - - S_AIR_2DAY - __assoc__: - - name - "UPS Second Day Air" - - enabled - "1" - - S_3DAYSELECT - __assoc__: - - name - "UPS Three-Day Select" - - enabled - "1" - - S_GROUND - __assoc__: - - name - "UPS Ground" - - enabled - "1" - - S_SURE_POST - __assoc__: - - name - "UPS Sure Post" - - enabled - "" - - S_STANDARD - __assoc__: - - name - "UPS Standard" - - enabled - "" - - S_WW_EXPRESS - __assoc__: - - name - "UPS Worldwide Express" - - enabled - "" - - S_WW_EXPRESSPLUS - __assoc__: - - name - "UPS Worldwide Express Plus" - - enabled - "" - - S_WW_EXPEDITED - __assoc__: - - name - "UPS Worldwide Expedited" - - enabled - "" - - S_SAVER - __assoc__: - - name - "UPS Saver" - - enabled - "" - - S_ACCESS_POINT - __assoc__: - - name - "UPS Access Point Economy" - - enabled - "" - - S_UPSTODAY_STANDARD - __assoc__: - - name - "UPS Today Standard" - - enabled - "" - - S_UPSTODAY_DEDICATEDCOURIER - __assoc__: - - name - "UPS Today Dedicated Courier" - - enabled - "" - - S_UPSTODAY_INTERCITY - __assoc__: - - name - "UPS Today Intercity" - - enabled - "" - - S_UPSTODAY_EXPRESS - __assoc__: - - name - "UPS Today Express" - - enabled - "" - - S_UPSTODAY_EXPRESSSAVER - __assoc__: - - name - "UPS Today Express Saver" - - enabled - "" - - S_UPSWW_EXPRESSFREIGHT - __assoc__: - - name - "UPS Worldwide Express Freight" - - enabled - "" - - TT_S_US_AIR_1DAYAM - __assoc__: - - name - "UPS Next Day Air Early" - - enabled - "" - - TT_S_US_AIR_1DAY - __assoc__: - - name - "UPS Next Day Air" - - enabled - "" - - TT_S_US_AIR_SAVER - __assoc__: - - name - "UPS Next Day Air Saver" - - enabled - "" - - TT_S_US_AIR_2DAYAM - __assoc__: - - name - "UPS Second Day Air A.M." - - enabled - "" - - TT_S_US_AIR_2DAY - __assoc__: - - name - "UPS Second Day Air" - - enabled - "" - - TT_S_US_3DAYSELECT - __assoc__: - - name - "UPS Three-Day Select" - - enabled - "" - - TT_S_US_GROUND - __assoc__: - - name - "UPS Ground" - - enabled - "" - - TT_S_US_AIR_1DAYSATAM - __assoc__: - - name - "UPS Next Day Air Early (Saturday Delivery)" - - enabled - "" - - TT_S_US_AIR_1DAYSAT - __assoc__: - - name - "UPS Next Day Air (Saturday Delivery)" - - enabled - "" - - TT_S_US_AIR_2DAYSAT - __assoc__: - - name - "UPS Second Day Air (Saturday Delivery)" - - enabled - "" - - TT_S_US_INTL_EXPRESSPLUS - __assoc__: - - name - "UPS Worldwide Express Plus" - - enabled - "" - - TT_S_US_INTL_EXPRESS - __assoc__: - - name - "UPS Worldwide Express" - - enabled - "" - - TT_S_US_INTL_SAVER - __assoc__: - - name - "UPS Worldwide Express Saver" - - enabled - "" - - TT_S_US_INTL_STANDARD - __assoc__: - - name - "UPS Standard" - - enabled - "" - - TT_S_US_INTL_EXPEDITED - __assoc__: - - name - "UPS Worldwide Expedited" - - enabled - "" - - TT_S_EU_EXPRESSPLUS - __assoc__: - - name - "UPS Express Plus" - - enabled - "" - - TT_S_EU_EXPRESS - __assoc__: - - name - "UPS Express" - - enabled - "" - - TT_S_EU_SAVER - __assoc__: - - name - "UPS Express Saver" - - enabled - "" - - TT_S_EU_STANDARD - __assoc__: - - name - "UPS Standard" - - enabled - "" - - TT_S_EU_TO_EU_EXPRESSPLUS - __assoc__: - - name - "UPS Express Plus" - - enabled - "" - - TT_S_EU_TO_EU_EXPRESS - __assoc__: - - name - "UPS Express" - - enabled - "" - - TT_S_EU_TO_EU_SAVER - __assoc__: - - name - "UPS Express Saver" - - enabled - "" - - TT_S_EU_TO_EU_STANDARD - __assoc__: - - name - "UPS Standard" - - enabled - "" - - TT_S_EU_TO_OTHER_EXPRESS_NA1 - __assoc__: - - name - "UPS Express NA 1" - - enabled - "" - - TT_S_EU_TO_OTHER_EXPRESSPLUS - __assoc__: - - name - "UPS Worldwide Express Plus" - - enabled - "" - - TT_S_EU_TO_OTHER_EXPRESS - __assoc__: - - name - "UPS Express" - - enabled - "" - - TT_S_EU_TO_OTHER_SAVER - __assoc__: - - name - "UPS Express Saver" - - enabled - "" - - TT_S_EU_TO_OTHER_EXPEDITED - __assoc__: - - name - "UPS Expedited" - - enabled - "" - - TT_S_EU_TO_OTHER_STANDARD - __assoc__: - - name - "UPS Standard" - - enabled - ""'
          - '- usps - __assoc__: - - name - USPS - - enabled - "" - - settings - __assoc__: - - username - UNKNOWN - - markUpRate - "" - - markUpBase - percentage - - services - __assoc__: - - PRIORITY_MAIL_EXPRESS_1_DAY - __assoc__: - - name - "USPS Priority Mail Express 1-Day" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 1-Day Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_SUNDAY_HOLIDAY_DELIVERY - __assoc__: - - name - "USPS Priority Mail Express 1-Day Sunday/Holiday Delivery" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 1-Day Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 1-Day Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_FLAT_RATE_ENVELOPE_SUNDAY_HOLIDAY_DELIVERY - __assoc__: - - name - "USPS Priority Mail Express 1-Day Flat Rate Envelope Sunday/Holiday Delivery" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_LEGAL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 1-Day Legal Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_LEGAL_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 1-Day Legal Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_LEGAL_FLAT_RATE_ENVELOPE_SUNDAY_HOLIDAY_DELIVERY - __assoc__: - - name - "USPS Priority Mail Express 1-Day Legal Flat Rate Envelope Sunday/Holiday Delivery" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_PADDED_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 1-Day Padded Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_PADDED_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 1-Day Padded Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_1_DAY_PADDED_FLAT_RATE_ENVELOPE_SUNDAY_HOLIDAY_DELIVERY - __assoc__: - - name - "USPS Priority Mail Express 1-Day Padded Flat Rate Envelope Sunday/Holiday Delivery" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY - __assoc__: - - name - "USPS Priority Mail Express 2-Day" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 2-Day Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 2-Day Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 2-Day Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_LEGAL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 2-Day Legal Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_LEGAL_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 2-Day Legal Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_PADDED_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail Express 2-Day Padded Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_2_DAY_PADDED_FLAT_RATE_ENVELOPE_HOLD_FOR_PICKUP - __assoc__: - - name - "USPS Priority Mail Express 2-Day Padded Flat Rate Envelope Hold For Pickup" - - enabled - "" - - PRIORITY_MAIL_1_DAY - __assoc__: - - name - "USPS Priority Mail 1-Day" - - enabled - "" - - PRIORITY_MAIL_1_DAY_LARGE_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 1-Day Large Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_1_DAY_MEDIUM_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 1-Day Medium Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_1_DAY_SMALL_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 1-Day Small Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_1_DAY_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_1_DAY_LEGAL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Legal Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_1_DAY_PADDED_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Padded Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_1_DAY_GIFT_CARD_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Gift Card Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_1_DAY_SMALL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Small Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_1_DAY_WINDOW_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 1-Day Window Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY - __assoc__: - - name - "USPS Priority Mail 2-Day" - - enabled - "" - - PRIORITY_MAIL_2_DAY_LARGE_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 2-Day Large Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_2_DAY_MEDIUM_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 2-Day Medium Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_2_DAY_SMALL_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 2-Day Small Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_2_DAY_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY_LEGAL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Legal Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY_PADDED_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Padded Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY_GIFT_CARD_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Gift Card Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY_SMALL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Small Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_2_DAY_WINDOW_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 2-Day Window Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY - __assoc__: - - name - "USPS Priority Mail 3-Day" - - enabled - "" - - PRIORITY_MAIL_3_DAY_LARGE_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 3-Day Large Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_3_DAY_MEDIUM_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 3-Day Medium Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_3_DAY_SMALL_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail 3-Day Small Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_3_DAY_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY_LEGAL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Legal Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY_PADDED_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Padded Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY_GIFT_CARD_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Gift Card Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY_SMALL_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Small Flat Rate Envelope" - - enabled - "" - - PRIORITY_MAIL_3_DAY_WINDOW_FLAT_RATE_ENVELOPE - __assoc__: - - name - "USPS Priority Mail 3-Day Window Flat Rate Envelope" - - enabled - "" - - FIRST_CLASS_MAIL - __assoc__: - - name - "USPS First-Class Mail" - - enabled - "" - - FIRST_CLASS_MAIL_STAMPED_LETTER - __assoc__: - - name - "USPS First-Class Mail Stamped Letter" - - enabled - "" - - FIRST_CLASS_MAIL_METERED_LETTER - __assoc__: - - name - "USPS First-Class Mail Metered Letter" - - enabled - "" - - FIRST_CLASS_MAIL_LARGE_ENVELOPE - __assoc__: - - name - "USPS First-Class Mail Large Envelope" - - enabled - "" - - FIRST_CLASS_MAIL_POSTCARDS - __assoc__: - - name - "USPS First-Class Mail Postcards" - - enabled - "" - - FIRST_CLASS_MAIL_LARGE_POSTCARDS - __assoc__: - - name - "USPS First-Class Mail Large Postcards" - - enabled - "" - - FIRST_CLASS_PACKAGE_SERVICE_RETAIL - __assoc__: - - name - "USPS First-Class Package Service - Retail" - - enabled - "" - - MEDIA_MAIL_PARCEL - __assoc__: - - name - "USPS Media Mail Parcel" - - enabled - "" - - LIBRARY_MAIL_PARCEL - __assoc__: - - name - "USPS Library Mail Parcel" - - enabled - "" - - USPS_GXG_ENVELOPES - __assoc__: - - name - "USPS Global Express Guaranteed Envelopes" - - enabled - "" - - PRIORITY_MAIL_EXPRESS_INTERNATIONAL - __assoc__: - - name - "USPS Priority Mail Express International" - - enabled - "" - - PRIORITY_MAIL_INTERNATIONAL - __assoc__: - - name - "USPS Priority Mail International" - - enabled - "" - - PRIORITY_MAIL_INTERNATIONAL_LARGE_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail International Large Flat Rate Box" - - enabled - "" - - PRIORITY_MAIL_INTERNATIONAL_MEDIUM_FLAT_RATE_BOX - __assoc__: - - name - "USPS Priority Mail International Medium Flat Rate Box" - - enabled - "" - - FIRST_CLASS_MAIL_INTERNATIONAL - __assoc__: - - name - "USPS First-Class Mail International" - - enabled - "" - - FIRST_CLASS_PACKAGE_INTERNATIONAL_SERVICE - __assoc__: - - name - "USPS First-Class Package International Service" - - enabled - ""'

I also had some of the settings in the php config file:

<?php

return [
  '*' => [
    'pluginName' => 'Postie',
    'hasCpSection' => true,
    'enableCaching' => true,
    'displayDebug' => false,
    'displayErrors' => false,
    'manualFetchRates' => true,
    'fetchRatesPostValue' => 'postie-fetch-rates',
    'providers' => [
      'usps' => [
        'settings' => [
          'username' => 'UNKNOWN',
        ],
      ],
      'ups' => [
        'settings' => [
          'apiKey' => getenv('UPS_ACCESS_KEY'),
          'testApiKey' => getenv('UPS_ACCESS_KEY'),
          'username' => getenv('UPS_USERNAME'),
          'password' => getenv('UPS_PASSWORD'),
        ],
      ],
    ],
  ]
];

I'm curious if it's an issue with using settings in both places.

engram-design commented 3 years ago

Thanks for the info, that's very interesting. I'm doing the same thing with a config file - it shouldn't do anything like what you're describing. I've even setup a fresh Commerce install with your settings, with no luck.

FYI, I noticed your API details are in your config output, so just edited them out for you.

I'll continue trying to reproduce this...

simeon-smith commented 3 years ago

Oh, thank you! Didn't figure they would be since I was using envs.

Happy to try and provide more context if you need.

engram-design commented 3 years ago

This is pretty consistent right? Happens each time you rebuild? I know you mentioned sometimes it flattens them.

cc @andris-sevcenko just in case this is a Craft issue?

simeon-smith commented 3 years ago

The enabled settings getting changed from '1' to '' is consistent on every rebuild. The flattening happens sometimes when I change settings somewhere else in the CMS.

andris-sevcenko commented 3 years ago

@simeon-smith to be clear, the config file is named postie.php, right?

engram-design commented 3 years ago

@andris-sevcenko I would assume so!

andris-sevcenko commented 3 years ago

I think I have an idea of what's going on. I'll work on a reproducible scenario.

simeon-smith commented 3 years ago

@andris-sevcenko yup, that's the name.

andris-sevcenko commented 3 years ago

@simeon-smith can you post a new issue over at craftcms/cms and reference this one?

Also, if you use getenv, the environment variables get substituted for the real ones when saving plugin settings, so the values will make their way into the project config. The best way here would be to use $UPS_ACCESS_KEY and have Postie support environment variables for those settings inside the plugin.

simeon-smith commented 3 years ago

@andris-sevcenko will do!

Thank you for the tip. Can I do this in the config php file? Until this issue is resolved I need to utilize that file for all settings to be safe.

andris-sevcenko commented 3 years ago

Thank you for the tip. Can I do this in the config php file?

If Postie processes those settings using Craft::parseEnv() it should work, yeah.

johnj24 commented 3 years ago

Was anything more ever found about this issue? Each time I switch on or off a shipping method within USPS all of my shipping category conditions get reset. I imagine this would be the same for all providers, but I've only been using USPS in my case.

engram-design commented 3 years ago

@johnj24 I think that's a slightly unrelated issue but fixed in 2.4.7

@andris-sevcenko Postie also supports environment variables for everything.

Also note that saving settings for disabled providers will no longer save their settings. Otherwise, the plugin settings becomes massive (for saving all provider settings).