madebyraygun / trending-posts

Trending Posts for Craft CMS 3 tracks pageviews over time and orders posts by popularity on the front-end.
MIT License
6 stars 3 forks source link

Siteid Issue #19

Open laneigemud1990 opened 2 years ago

laneigemud1990 commented 2 years ago

Hi all, We've discovered an issue where the SQL query fails if the siteid does not equal 1.

As you can see from the screenshot below, our site has been registered with an id of 2, (I assume that a multisite was started the subsequently removed) therefore the foreign key integrity check fails.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ('sitename'.'trendingposts', CONSTRAINT 'fk_ktriebowweqyiolpnvjmgaetkpvvopivaezb' FOREIGN KEY ('siteId') REFERENCES 'sites' ('id') ON DELETE CASCADE ON UPDATE CASCADE) in /srv/users/username/apps/sitename/vendor/yiisoft/yii2/db/Command.php:1302

Screenshot 2022-05-06 at 16 07 04
daltonrooney commented 2 years ago

Hi @laneigemud1990, sorry you're having trouble with the plugin. We were already in the process of a code review and have decided to no longer publish this plugin to the Craft Plugin Store. We recommend https://plugins.craftcms.com/view-count as an alternative.