backdrop-contrib / commerce

GNU General Public License v2.0
3 stars 5 forks source link

Undefined property: CommerceCustomerProfile::$name #25

Closed mr-simba closed 2 weeks ago

mr-simba commented 2 weeks ago

Location: http://xxx/checkout/1/review Refferer: http://xxx/checkout/1 Notice: Undefined property: CommerceCustomerProfile::$name in CommerceCustomerProfile->label() (Zeile 23 von /xxx/modules/commerce/modules/customer/includes/commerce_customer.entity.inc).

and

Location: http://xxx/checkout/1/review Refferer: http://xxx/checkout/1 Error: Unsupported operand types in template_preprocess_entity() (Zeile 22 von /xxx/core/modules/entity/entity.theme.inc).

Checkout with Billing information. Format handlers of the address-field:

After clicking on Continue to next step, the errors above are shown.

Screenshot 2024-11-09 at 11-52-44 Checkout Backdrop Test Site

argiepiano commented 2 weeks ago

These seem like two unrelated issues with two different solutions.

For Undefined property: CommerceCustomerProfile::$name the solution is to define CommerceCustomerProfile::$name inside the class definition. Alternatively (or in addition) we could initialize that property inside CommerceCustomerProfileEntityController::create().

For the second problem, Error: Unsupported operand types in template_preprocess_entity(), you can't return NULL in CommerceCustomerProfile::uri(). Instead return an empty array.

argiepiano commented 2 weeks ago

PR provided: #26