[僅限PaaS]{class="badge informative" title="僅適用於雲端專案(Adobe管理的PaaS基礎結構)和內部部署專案的Adobe Commerce 。"}
ACSD-64523: REST端點無法驗證必要欄位
ACSD-64523修補程式修正REST端點[V1/import/csv]無法驗證必要欄位的問題,允許建立不含必要資料的產品。 若要解決此問題,請更新Authorization標頭。安裝Quality Patches Tool (QPT) 1.1.62時,即可使用此修補程式。 請注意,此問題已排程在Adobe Commerce 2.4.8中修正。
受影響的產品和版本
已為Adobe Commerce版本建立修補程式:
- Adobe Commerce (所有部署方法) 2.4.7-p3
與Adobe Commerce版本相容:
- Adobe Commerce (所有部署方法) 2.4.7 - 2.4.7-p4
NOTE
此修補程式可能適用於發行版本為Quality Patches Tool的其他版本。 若要檢查修補程式是否與您的Adobe Commerce版本相容,請將
magento/quality-patches套件更新至最新版本,並在Quality Patches Tool上檢查相容性:搜尋修補程式頁面。 使用修補程式ID作為搜尋關鍵字,以尋找修補程式。問題
REST端點[V1/import/csv]無法驗證必要欄位,允許建立產品而不提供這些必要欄位。
要再現的步驟:
-
執行以下裝載(更新Authorization標頭):
code language-none curl --location 'http://<domain>/rest/default/V1/import/json' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer xxxxx' \ --data '{ "source": { "locale": "en_AU", "entity": "catalog_product", "behavior": "append", "validation_strategy": "validation-stop-on-errors", "allowed_error_count": 0, "items": [ { "sku": "product_sku", "product_online": "no", "attribute_set_code": "Default", "product_type": "configurable", "product_websites": "base", "store_view_code": "default", "name": null, "description": null, "short_description": null, "weight": null, "tax_class_name": null, "visibility": null, "price": null, "url_key": null, "cost": null, "additional_attributes": { "special_price": "", "retail_price": "" }, "configurable_variations": [] } ] } }'
預期結果:
應用程式應防止儲存不含必填欄位的產品。
實際結果:
已成功儲存產品,但未指定產品名稱(這是必要的屬性)。 因此,我們無法存取後端產品格線,並出現下列錯誤。
Warning: Undefined array key "name" in /app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php on line 91
套用修補程式
若要套用個別修補程式,請根據您的部署方法使用下列連結:
- Adobe Commerce或Magento Open Source內部部署: Quality Patches Tool 指南中的>使用狀況Quality Patches Tool。
- 雲端基礎結構上的Adobe Commerce:雲端基礎結構上的Commerce指南中的升級和修補程式>套用修補程式。
相關閱讀
若要進一步瞭解Quality Patches Tool,請參閱:
recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3