• Resolved chrisbotkins

    (@chrisbotkins)


    As of last week (July 22, 2022) we started noticing PHP Fatal Errors in our log files related to the USPS Simple Shipping plugin. Here is the error it’s throwing:

    PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Dgm\UspsSimple\Calc::buildExtPackageId() must be of the type int, float given, called in /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/Calc.php on line 117 and defined in /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/Calc.php:286
    Stack trace:
    #0 /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/Calc.php(117): Dgm\UspsSimple\Calc::buildExtPackageId('c727a25d42cf3a6...', 1, Object(Dgm\UspsSimple\Calc\Dim), 10.99997794544)
    #1 /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/Calc.php(48): Dgm\UspsSimple\Calc::buildSubRequests(Object(Dgm\UspsSimple\Calc\Package), true, false)
    #2 /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/ShippingMethod.php(199): Dgm\UspsSimple\Calc->calc(Object(Dgm\UspsSimple\Calc\Request), Object(Dgm\UspsSimple\Debug))
    #3 /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/ShippingMethod.p in /home/weatherby/public_html/wp-content/plugins/woo-usps-simple-shipping/src/Calc.php on line 286

    We are running Version 1.7.0 of the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter chrisbotkins

    (@chrisbotkins)

    Here are the USPS debug details from the cart page:

    array (
      'error' => 'API reports an error. Data: {
        "response": "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n<Error><Number>-2147219099</Number><Source>clsRateV4:UnpackRateNode</Source><Description>Missing value for ZipDestination.</Description><HelpFile/><HelpContext/></Error>\\n"
    }.',
      'rates' => NULL,
      'settings' => 
      array (
        'props' => 
        array (
          'sender' => '82801',
          'commercialRates' => true,
          'groupByWeight' => true,
          'apiEndpoint' => 'https://secure.shippingapis.com/ShippingAPI.dll',
          'apiUserId' => '169WEATH1625',
          'supports' => 
          array (
            0 => 'settings',
          ),
          'id' => 'usps_simple',
          'method_title' => 'USPS Simple',
          'method_description' => 'Shows live USPS domestic rates on checkout',
          'enabled' => 'yes',
          'title' => 'USPS Simple',
          'rates' => 
          array (
          ),
          'tax_status' => 'taxable',
          'fee' => NULL,
          'minimum_fee' => NULL,
          'instance_id' => 0,
          'instance_form_fields' => 
          array (
          ),
          'instance_settings' => 
          array (
          ),
          'availability' => NULL,
          'countries' => 
          array (
          ),
          'plugin_id' => 'woocommerce_',
          'errors' => 
          array (
          ),
          'data' => 
          array (
          ),
        ),
        'settings' => 
        array (
          'enabled' => 'yes',
          'sender' => '82801',
          'user_id' => '169WEATH1625',
          'commercial_rate' => 'yes',
          'group_by_weight' => 'yes',
          'express_mail' => '',
          't_express_mail' => '',
          'express_mail_3' => 'no',
          'express_mail_2' => 'no',
          'express_mail_23' => 'no',
          'priority_mail' => '',
          't_priority_mail' => 'Priority Mail (USPS)',
          'priority_mail_1' => 'yes',
          'priority_mail_33' => 'no',
          'priority_mail_18' => 'no',
          'priority_mail_47' => 'no',
          'priority_mail_48' => 'no',
          'priority_mail_49' => 'no',
          'priority_mail_50' => 'no',
          'first_class_mail' => '',
          't_first_class' => 'First-Class Mail (USPS)',
          'first_class_0A' => 'no',
          'first_class_0B' => 'no',
          'first_class_0C' => 'no',
          'first_class_0D' => 'no',
          'first_class_12' => 'no',
          'first_class_15' => 'no',
          'first_class_19' => 'no',
          'first_class_61' => 'no',
          'first_class_53' => 'no',
          'first_class_78' => 'no',
          'standard_post' => '',
          't_standard_post' => '',
          'standard_post_4' => 'no',
          'media_mail' => '',
          't_media_mail' => '',
          'media_mail_6' => 'no',
          'library_mail' => '',
          't_library_mail' => '',
          'library_mail_7' => 'no',
        ),
      ),
      'package' => 
      array (
        'contents' => 
        array (
          '4b1905cff5bc8b47ae1c9d92e2c759df' => 
          array (
            'key' => '4b1905cff5bc8b47ae1c9d92e2c759df',
            'product_id' => 31562,
            'variation_id' => 0,
            'variation' => 
            array (
            ),
            'quantity' => 1,
            'data_hash' => 'b5c1d5ca8bae6d4896cf1807cdf763f0',
            'line_tax_data' => 
            array (
              'subtotal' => 
              array (
              ),
              'total' => 
              array (
              ),
            ),
            'line_subtotal' => 54.0,
            'line_subtotal_tax' => 0,
            'line_total' => 54.0,
            'line_tax' => 0,
            'product' => 
            array (
              'name' => '7mm Weatherby Magnum Hornady',
              'slug' => '7mm-weatherby-magnum-hornady',
              'price' => '54.00',
              'regular_price' => '69.00',
              'sale_price' => '54.00',
              'weight' => '48 oz',
              'weight_lbs' => 2.9999939851199997,
              'dimensions' => '8 x 8 x 5 in',
              'dimensions_in' => '8 x 8 x 5',
            ),
          ),
        ),
        'contents_cost' => 54.0,
        'applied_coupons' => 
        array (
        ),
        'user' => 
        array (
          'ID' => 0,
        ),
        'destination' => 
        array (
          'country' => 'US',
          'state' => '',
          'postcode' => '',
          'city' => '',
          'address' => '',
          'address_1' => '',
          'address_2' => '',
        ),
        'cart_subtotal' => '54',
        'csp_variables' => 
        array (
          'billing_email' => '',
          'billing_country' => 'US___202272510',
        ),
        'rates' => 
        array (
        ),
      ),
      'requests' => 
      Dgm\UspsSimple\Calc\Pair::__set_state(array(
         'online' => NULL,
         'standard' => NULL,
      )),
      'request' => 
      Dgm\UspsSimple\Calc\Request::__set_state(array(
         'apiUserId' => '169WEATH1625',
         'package' => 
        Dgm\UspsSimple\Calc\Package::__set_state(array(
           'orig' => 
          Dgm\UspsSimple\Calc\Area::__set_state(array(
             'countryCode' => 'US',
             'zipCode' => '82801',
          )),
           'dest' => 
          Dgm\UspsSimple\Calc\Area::__set_state(array(
             'countryCode' => 'US',
             'zipCode' => '',
          )),
           'items' => 
          array (
            '4b1905cff5bc8b47ae1c9d92e2c759df' => 
            Dgm\UspsSimple\Calc\Item::__set_state(array(
               'product' => 
              Dgm\UspsSimple\Calc\Product::__set_state(array(
                 'weight' => 2.9999939851199997,
                 'dim' => 
                Dgm\UspsSimple\Calc\Dim::__set_state(array(
                   'length' => 8.0,
                   'width' => 8.0,
                   'height' => 5.0,
                )),
              )),
               'quantity' => 1,
            )),
          ),
        )),
         'services' => 
        Dgm\UspsSimple\Calc\Services::__set_state(array(
           'retailGroundEnabled' => false,
           'serviceMatchersByCode' => 
          array (
            1 => 
            array (
              0 => 
              Dgm\UspsSimple\Calc\MatchAny::__set_state(array(
                 'service' => 
                Dgm\UspsSimple\Calc\Service::__set_state(array(
                   'family' => 
                  Dgm\UspsSimple\Calc\ServiceFamily::__set_state(array(
                     'id' => 'priority_mail',
                     'title' => 'Priority Mail (USPS)',
                     'sort' => 1,
                  )),
                   'fitFn' => NULL,
                )),
              )),
            ),
          ),
        )),
         'groupByWeight' => true,
         'commercialRates' => true,
      )),
      'responses' => 
      Dgm\UspsSimple\Calc\Pair::__set_state(array(
         'online' => '<?xml version="1.0" encoding="UTF-8"?>
    <Error>
        <Number>-2147219099</Number>
        <Source>clsRateV4:UnpackRateNode</Source>
        <Description>Missing value for ZipDestination.</Description>
        <HelpFile/>
        <HelpContext/>
    </Error>
    ',
         'standard' => NULL,
      )),
      'combinedResponse' => '<?xml version="1.0" encoding="UTF-8"?>
    <Error>
        <Number>-2147219099</Number>
        <Source>clsRateV4:UnpackRateNode</Source>
        <Description>Missing value for ZipDestination.</Description>
        <HelpFile/>
        <HelpContext/>
    </Error>
    ',
    )
    Plugin Author Dan

    (@dangoodman)

    Thank you for the details.

    Could you check if 1.7.1 works for you?

    Thread Starter chrisbotkins

    (@chrisbotkins)

    I just updated, I’ll keep an eye on the logs and let you know. Thank you for hopping on this so quickly!

    Thread Starter chrisbotkins

    (@chrisbotkins)

    This looks to be all resolved and fixed with the update.

    Thank you again for all your help and jumping on this quickly. I really appreciate it.

    Plugin Author Dan

    (@dangoodman)

    Great! Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Fatal Error in error log’ is closed to new replies.