Ensuring Classes that implement the IAction interface have a unique 'Letter'
I am doing an increasing amount of work extending Umbraco recently and one thing I have come across is a problem with the custom menus not being able to ensure a unique "Letter" is assigned to the class implementing IAction. What happens is if another package is using the same letter your menus get mixed up and has undesired results.
Anyone else experienced the same or similar? How do you work around it as I can't see a way to ensure that the letter is globally unique?
Is this something that will be addressed in the 4.1 release?
There's no workaround to this design flaw other than to document what letters you use (obscure characters are supported though). When I made the IAction interface six years ago I had bytes in mind (as for each node in the tree a list of allowed actions are passed in the XHR request) and I couldn't imagine that there was a need for more than 200 actions.
I have the exact same issue with my latest two packages. There is a wiki post about which letters are used by Umbraco by default, but as for 4.x until 4.1 it might be an idea to create a shared list of which letters different packages are using - although not a very optimal way of doing it.
Another thing that I have noticed is that it is also a problem when using notifications, because you will have multiple actions with the same Letter.
+1 for whether this issue will be addressed in the 4.1 release.
I agree that a dedicated wiki page listing all currently in use letters would be a good idea as an interim measure. Shame its not going to be addressed in v4.x because that means it will be around for a long time since there will be no "official" upgrade path from 4 > 5 that I am aware of.
Richard your idea is handy since it does reduce the risk of clashing letters however it is still pot luck as to whether or not someone made the same choice as you in their package which may reside in the same installation.
I am developing a package that uses a config file. I would recommend that you retrieve the letter from a config file, this way the installers of your package can change the Letter if it bothers an existing package.
Ensuring Classes that implement the IAction interface have a unique 'Letter'
I am doing an increasing amount of work extending Umbraco recently and one thing I have come across is a problem with the custom menus not being able to ensure a unique "Letter" is assigned to the class implementing IAction. What happens is if another package is using the same letter your menus get mixed up and has undesired results.
Anyone else experienced the same or similar? How do you work around it as I can't see a way to ensure that the letter is globally unique?
Is this something that will be addressed in the 4.1 release?
I've got the same problem. If you look at the bottom of this wiki at least you know which letters have already been assigned: http://our.umbraco.org/wiki/reference/backoffice-apis/tree-api---to-create-custom-treesapplications. I haven't find a workaround yet though.
Jeroen
There's no workaround to this design flaw other than to document what letters you use (obscure characters are supported though). When I made the IAction interface six years ago I had bytes in mind (as for each node in the tree a list of allowed actions are passed in the XHR request) and I couldn't imagine that there was a need for more than 200 actions.
In v5 we'll change this behaviour.
Hi Simon,
I have the exact same issue with my latest two packages. There is a wiki post about which letters are used by Umbraco by default, but as for 4.x until 4.1 it might be an idea to create a shared list of which letters different packages are using - although not a very optimal way of doing it.
Another thing that I have noticed is that it is also a problem when using notifications, because you will have multiple actions with the same Letter.
+1 for whether this issue will be addressed in the 4.1 release.
- Morten
HI,
Great Idea to share the letters, I will dig into my source codes for that.
One Tip:
You can use unicode characters so you can have more than 200 characters and characters like (Hope this could be displayed in HTML)
Hope this helps.
I use ALT+06565 as an example.
I agree that a dedicated wiki page listing all currently in use letters would be a good idea as an interim measure. Shame its not going to be addressed in v4.x because that means it will be around for a long time since there will be no "official" upgrade path from 4 > 5 that I am aware of.
Richard your idea is handy since it does reduce the risk of clashing letters however it is still pot luck as to whether or not someone made the same choice as you in their package which may reside in the same installation.
Changing it for 4.1 would break all existing packages that implements IAction should that would be even worse IMHO.
4.1 is feature frozen btw, so don't expect anything new in there :)
I am developing a package that uses a config file. I would recommend that you retrieve the letter from a config file, this way the installers of your package can change the Letter if it bothers an existing package.
OK, I pull dibs on
(char)0x1337
and(char)0x7331
. :)is working on a reply...