doublesecretagency / craft-viewcount

View Count plugin for Craft CMS
Other
6 stars 4 forks source link

Using total views field type breaks ability to create entries in Craft 4. #24

Closed tom-byrom closed 2 years ago

tom-byrom commented 2 years ago

Using the Total Views fieldtype in Craft 4 you cannot create new elements or in my case entries either from the dashboard or FE.

The error is

error: "doublesecretagency\\viewcount\\services\\Query::total(): Argument #1 ($elementId) must be of type int, null given, called in /apps/staging-craft4-web-app/vendor/doublesecretagency/craft-viewcount/src/fields/TotalViews.php on line 118"

Existing entries created before plugin install can be updated and the view count displays fine as a read only field on those. The issue is impacting newly created entries.

lindseydiloreto commented 2 years ago

This is fixed in v1.1.1. Thanks for reporting it! 👍