Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Duplicate action for edit product does check permission via the Elements service to determine whether the Save as new product button is shown in the cp #3819

Open
samhibberd opened this issue Dec 17, 2024 · 2 comments
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce

Comments

@samhibberd
Copy link

What happened?

Description

Running into this issue (#3285) with the Duplication logic, needs hooking up i think:

Image

Steps to reproduce

  1. Set $e->authorized = false via the Elements::EVENT_AUTHORIZE_DUPLICATE

Expected behavior

Should hide: Save as new product

Craft CMS version

4.12.5

Craft Commerce version

4.6.13

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@samhibberd samhibberd added bug commerce4 Issues related to Commerce v4 Craft Commerce labels Dec 17, 2024
@samhibberd
Copy link
Author

More importantly it doesn't currently prevent duplication / throw an exception in the case that the duplicate action is called and the action is not authorized. Need to ensure it calls the Elements service to hook into the service level authorization events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce
Projects
None yet
Development

No branches or pull requests

1 participant