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

Call to a member function can() on null when adding Taxonomy Terms input to Product Variants field. #1076

Closed
sbrow opened this issue May 21, 2024 · 3 comments · Fixed by #1085

Comments

@sbrow
Copy link
Contributor

sbrow commented May 21, 2024

Description

I've created a "Shipping Class" taxonomy so I can assign prices to products based on their size/weight. Some of my products have a different shipping class based on their product variant (I'm using quantity based pricing). Everything works fine until I add the "Shipping Class" taxonomy term fieldtype into the "Product Variants" fieldtype, at which point, Guest Users are no longer able to view the "Products" page.

ppn test_shop

Steps to reproduce

  1. Log in as an admin.
  2. Create a new taxonomy and assign it to products.
  3. Add a "taxonomy terms" fieldtype to the "product variants" field in your "Variable Product" blueprint.
  4. Log out
  5. Visit the "products/shop" page.

Environment

Environment
Application Name:
Laravel Version: 11.7.0
PHP Version: 8.2.13
Composer Version: 2.6.5
Environment: local
Debug Mode: ENABLED
URL:
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Simple Commerce
Currencies: USD
Gateways: Stripe
Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\UserCustomerRepository
Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository
Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping
Tax Engine: DuncanMcClean\SimpleCommerce\Tax\Standard\TaxEngine

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.5.1
PHP SDK Version: 4.7.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: 100%
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 7
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.0.2 PRO

Statamic Addons
arthurperton/wordpress-users: 1.1.1
duncanmcclean/guest-entries: 4.0.0
duncanmcclean/simple-commerce: 7.0.1
sbrow/sc-checkout: dev-5dcefce85614781a2529c6b0ad8ae8c661a7bb0c
sbrow/sc-subscriptions: dev-5dcefce85614781a2529c6b0ad8ae8c661a7bb0c
sbrow/banner: dev-5dcefce85614781a2529c6b0ad8ae8c661a7bb0c
statamic/seo-pro: 6.0.1

@sbrow
Copy link
Contributor Author

sbrow commented May 30, 2024

Hi @duncanmcclean, I've looked into this issue and determined that the "root" cause of the issue actually lies in the underlying Statamic code. If they accept my PR (statamic/cms#10232), then I will close this issue; but if they feel a need to require users to authenticate before calling \Statamic\Fields\Fields->getCreatables(), then it'd be simple commerce that needs an update in order to work (for me), in which case I'd start a separate PR here.

Keep up the good work! 😄

Copy link

Released as part of v7.2.1.

@sbrow
Copy link
Contributor Author

sbrow commented May 31, 2024

That solved the problem for me. Thank you kindly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants