Goldinteractive / craft3-sitecopy

With this plugin you can copy the content of an entry to another site.
MIT License
22 stars 6 forks source link

SiteId to sourceSite Comparison breaking change #13

Closed adevendorf closed 4 years ago

adevendorf commented 4 years ago

Looks like the latest change completely broke the functionality of this plugin.

With Line 167 in services/SiteCopy.php (see code below), siteId is an integer, but sourceSite is a string. Changing it so it's not so strict fixes the problem.

if ($entry->siteId !== $elementSettings['sourceSite']) { return; }

Can anyone explain the reasoning for the change, or is this a bug?

lukasNo1 commented 4 years ago

Which craft version do you use? I tested it with Craft 3.4.9, where the siteId is returned as string. Craft doku says its an integer though.

I will remove the strict check for compatibility with past/future versions.

adevendorf commented 4 years ago

This is using the latest version as of yesterday 3.4.17.1

adevendorf commented 4 years ago

I should add, I noticed the plugin had stopped working before I upgraded to 3.4 as well (from 3.3.20)

lukasNo1 commented 4 years ago

Weird. i also get a string siteId on my entries in 3.4.17.1. Gonna investigate this further.

I just released version 0.5.2, where i removed the strict check. It should work for both cases now.