Too many repeated access checks on product edit

Created on 21 October 2012, over 12 years ago
Updated 7 July 2025, 5 days ago

While I was debugging some issues with the translation of commerce_product with new entity_translation dev version, I added a dsm($op) in commerce_product_access(). Then when I visited a product edit page, I found that following printed on product edit page.


    update

    update

    update

    update

    update

    create

    create

    update

This let me to the conclusion that we are checking access for $op ='update' 6 times and $op='create' 2 times. I am not sure if this is needed. Also why should we add access check to 'create' op in the product edit screen?

If this is an intended behaviour, can anyone pls take sometime to explain why? It could be useful for the community to know the logic behind this.

Thanks

📌 Task
Status

Closed: won't fix

Version

1.0

Component

Product

Created by

🇮🇳India krishworks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024