Apostrophe in rule name stops rule export - Bug?

[Update] it is the apostrophe in the name not the length. So I guess the bug is there is no error message given it just does not save the file.

I am moving rules from one hub to another and using export. I got to a group of rules that would not export. It turned out that is was the rule name causing it. Apparently there is a limit to the length. The main issue was, it gave no indication of why it would not export. You can just click through the buttons and nothing happens. Nothing was put in the log either.
The rule below can not be exported.

Are you sure it is the length? Have you been able to export a shorter version of that same rule? The reason I ask is I am wondering whether it is more the apostrophe rather than the length.

Either way, you are right that it would be good to see some kind of error message displayed / recorded.

1 Like

Yes you can export the rules if you shorten the name.

[edit] your are right it is the apostrophe. It took a minute after I read your post for it to register. So it is not the length.

1 Like

I expect it is probably your PC that would be imposing that restriction on what special characters can be included in file names. There would be a limit to the length as well, just not sure how long that would be.

It actually occurred to me about special characters as the original rules had parenthesis in the name. I took those out and it made no difference. I knew it wasn't the dash as I had exported many rules and they all have dashes. So I just shortened the name to Climate - Export and it exported fine. So I decided it was the length. For some reason the apostrophe never registered with me.

Your brain was sanitizing the data and you never saw it. :wink:

Tagging @bravenel that rule names with included apostrophe cannot be exported.

This is from the attempt to create a default filename, the method for which will not allow an apostrophe (nor is it likely to be changed to do so). So the question becomes, what would you like the apostrophe to be replaced by?

You can, by the way, export an app with an apostrophe in the name if you export more than one at a single time -- in this case you supply the filename.

1 Like

I believe the issue the OP was raising was the silent fail.

Perhaps, if a problematic character is detected, prompt for the user to supply a file name.

This will be fixed in the next release: it will prompt for a filename for any app with an apostrophe in the name, instead of attempting (and failing) to create a filename.

5 Likes

That seems appropriate. If it had just popped up something on the screen or put something in the log I would have realized. It just so happen to be on a couple rules that had the longest names of any I had done to that point. So I just kind of honed in on that fact, without any thing else to look at.

Download the Hubitat app