From d8159554ce045f36b259fe231fa7af304cea8c7e Mon Sep 17 00:00:00 2001 From: Anna Heath Date: Thu, 17 Jul 2025 16:32:00 -0700 Subject: [PATCH] Entity property info fix and PHP 8.x compability fix Fixes #37 This commit incorporates some adjustments we made to address some entity property info issues where labels weren't rendering correctly. --- modules/customer/includes/commerce_customer.entity.inc | 3 +-- modules/line_item/includes/commerce_line_item.entity.inc | 2 +- .../payment/includes/commerce_payment_transaction.entity.inc | 2 +- modules/product/includes/commerce_product.entity.inc | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/customer/includes/commerce_customer.entity.inc b/modules/customer/includes/commerce_customer.entity.inc index 020f45c6..f358c6b6 100644 --- a/modules/customer/includes/commerce_customer.entity.inc +++ b/modules/customer/includes/commerce_customer.entity.inc @@ -6,7 +6,6 @@ class CommerceCustomerProfile extends Entity { public $langcode = LANGUAGE_NONE; - public $name = ''; public function __construct($values = array()) { parent::__construct($values, 'commerce_customer_profile'); @@ -21,7 +20,7 @@ class CommerceCustomerProfile extends Entity { } public function label() { - return $this->name; + return "Customer Profile (uid {$this->uid})"; } public function uri() { diff --git a/modules/line_item/includes/commerce_line_item.entity.inc b/modules/line_item/includes/commerce_line_item.entity.inc index 804a5ab2..0c18da1f 100644 --- a/modules/line_item/includes/commerce_line_item.entity.inc +++ b/modules/line_item/includes/commerce_line_item.entity.inc @@ -20,7 +20,7 @@ class CommerceLineItem extends Entity { } public function label() { - return $this->name; + return $this->line_item_id; } public function uri() { diff --git a/modules/payment/includes/commerce_payment_transaction.entity.inc b/modules/payment/includes/commerce_payment_transaction.entity.inc index dd4710d6..c7d283b4 100644 --- a/modules/payment/includes/commerce_payment_transaction.entity.inc +++ b/modules/payment/includes/commerce_payment_transaction.entity.inc @@ -20,7 +20,7 @@ class CommercePaymentTransaction extends Entity { } public function label() { - return $this->name; + return $this->transaction_id; } public function uri() { diff --git a/modules/product/includes/commerce_product.entity.inc b/modules/product/includes/commerce_product.entity.inc index 9f8f443a..5315e47d 100644 --- a/modules/product/includes/commerce_product.entity.inc +++ b/modules/product/includes/commerce_product.entity.inc @@ -20,7 +20,7 @@ class CommerceProduct extends Entity { } public function label() { - return $this->name; + return $this->title; } public function uri() {