Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jun 10, 2010 @ 11:12
    Simon Dingley
    2

    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?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 10, 2010 @ 11:16
    Jeroen Breuer
    0

    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

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jun 10, 2010 @ 11:19
    Niels Hartvig
    0

    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.

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Jun 10, 2010 @ 11:20
    Morten Christensen
    0

    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

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Jun 10, 2010 @ 11:49
    Richard Soeteman
    2

    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.

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Jun 10, 2010 @ 11:54
    Richard Soeteman
    0

    I use ALT+06565 as an example.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jun 10, 2010 @ 12:59
    Simon Dingley
    0

    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.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jun 10, 2010 @ 13:01
    Simon Dingley
    0

    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. 

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jun 10, 2010 @ 13:23
    Niels Hartvig
    0

    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 :)

  • Daniel Bardi 927 posts 2562 karma points
    Jun 11, 2010 @ 01:47
    Daniel Bardi
    1

    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.

  • Lars-Erik Aabech 350 posts 1102 karma points MVP 8x c-trib
    Mar 13, 2015 @ 14:25
    Lars-Erik Aabech
    0

    OK, I pull dibs on (char)0x1337 and (char)0x7331. :)

Please Sign in or register to post replies

Write your reply to:

Draft