Pennebaker / craftcms-thearchitect

CraftCMS plugin to generate content models from JSON data.
MIT License
171 stars 9 forks source link

Argument 1 passed to craft\services\Sites::getSiteById() must be of the type integer #66

Open england9911 opened 5 years ago

england9911 commented 5 years ago

When exporting various things, in my case sections, I kept running into the error:

Argument 1 passed to craft\services\Sites::getSiteById() must be of the type integer, string given, called in /vendor/pennebaker/craft-architect/src/base/Processor.php on line 297

The fix for this is pretty straightforward, I haven't added a PR for this as it doesn't look like they're being accepted here(?)

Anyway, if you open the mentioned file above and change line 297:

$site = Craft::$app->sites->getSiteById(($sites);

to

$site = Craft::$app->sites->getSiteById((int) $sites);

You should be able to continue!

brandondeweese commented 4 years ago

Is this plugin still supported? I've gotten this error for almost a year now....hoping this would finally get fixed at some point.