Issue adding layout from template via API in 2.0.3

I just updated from 2.0.2 to 2.0.3 and it appears to have broken my script that uses the API to create a new layout from a template.

It throws an error that says "you already own a playlist called ’ ’ ".

I’m guessing that this is now looking to put a name with the auto generated playlists for regions which had no names previously?

It is definitely a new issue coming from 2.0.3. I rolled back to 2.0.2 and the issue disappears.

The duplicate name check was indeed added in 2.0.3, however that should not affect creating a layout from template - it does not check the regionSpecific playlists names, it only checks the Playlists as in on the Playlist page.

I tried to create couple layouts from various templates, didn’t encounter any issues with them.

If I could have a look at your script or if you could describe the calls you’re making it might give me something to go on.

I reinstalled 2.0.3 and did some additional testing. It is a problem when you are using an existing playlist from a previous version. My template was originally created under 1.8. I’m guessing that because the playlists created under the old system did not have names assigned to them that is the reason that I keep getting an error that a playlist with no name already exists.

I haven’t tested this out fully but I am guessing I am also going to have all sorts of problems with the layouts across the 40 or so displays I have because they also likely do not have named playlists.

This issue was more than the API. You get the same error if you try to make a copy of old template within xibo.

I created a new template and there is no problem copying it or creating a layout from it.

I’m guessing that I am not the only one that will be running into this issue when upgrading from the older xibo.

I may just roll back again depending on if this has caused playlist errors on my old layouts too.

Update: I went ahead and rolled back to 2.0.2 because I appeared to be having other issues with the update when it came to my script that creates and assigns subplaylists to the layouts. Unfortunately I am heading out of country til the 20th tomorrow and don’t have anymore time to investigate the issue.

You’re correct, if you’d import a layout from 1.8, then it would be correct (playlists would have names), however for layouts existing in the CMS in 1.8, after CMS upgrade to 2.0.3, the playlist names are still set to empty string.

Which then interferes with the validation - as empty string was not passed to the query.

I will add a condition in the validation function to avoid this issue in the future (2.0.4).

Thank you for the details!

You should be able to work around this in 2.0.3, by changing the playlist name via
PUT /api/playlist/{playlistId}
with the name parameter in the body