When creating a site it is possible to not specify URLs. In this case, we send a plugin setting entry in the HTTP request as
['name' => 'urls'] w/ no
value key. Currently this is ignored by Matomo, and the validation that happens does not occur. Which allows sites to have no URLs.
If this happens and Overlay is loaded, the JS will error when trying to find the host of the site URLs.
This is fixed in this PR w/ tests. The issue in Overlay is also worked around in case there are users who created sites w/ no URLs.
@diosmosis this would be breaking API (even though in the code it should have already worked but from a user perspective things are potentially still breaking as it probably wasn't working for a while) and not sure if want to require URLs now or maybe wait to Matomo 5. Is there an issue for this PR?
👍 be great to have an issue to fix the addSite/updateSite API regarding requiring URLs as part of Matomo 5