•  
      request #31113 Simplify hook listening for plugins
    Infos
    #31113
    Manuel Vacelet (vaceletm)
    2023-04-05 10:32
    2023-03-03 12:07
    32701
    Details
    Simplify hook listening for plugins

    As of today, for plugins, listening to hooks is tedious, there is a lot of copy/paste and things are scattered at different places:

    • Usage of hooks must be declared in getHooksAndCallbacks
    • It's not easy to find the hook that correspond to a callback
    • There is a lot of repetition of the event: at hook declaration (getHooksAndCallbacks), at the name of the callback, at the first parameter name.

    Using attributes, we can greatly simplify that.

    Empty
    Empty
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Manuel Vacelet (vaceletm)
    Closed
    2023-03-30
    Attachments
    Empty
    References
    Referencing request #31113

    Git commit

    tuleap/tuleap/stable

    chore: Hooks can be listened to with Attributes 64be87d14c
    chore: Plugin::addHook is now deprecated 89d610212b
    chore: Deal with conditional event listening 62ae8e63a2
    chore: Remove addHook usage where $recall_hook is true 02611be7ce
    chore: remove $recall_hook parameter from addHook bbc792da31
    chore: Convert SvnPlugin to attribute based hook listening 9373249683
    chore: Convert DocmanPlugin to attribute based event listening 208eb3df2b
    chore: Convert some plugins to attribute based event listening 78546581ae
    chore: Convert mediawiki_standalone to attribute based event listening c016a2fc36
    chore: Convert FTS plugins to attribute based event listening 85644920b5
    chore: Convert Roadmap plugin to attribute based event listening 6091655692
    chore: Convert Baseline plugin to attribute based event listening 93e5a5fad8
    chore: Convert project_ownership plugin to attribute based event listening 27d9d7fdc7
    chore: Convert oauth2_server plugin to attribute based event listening 323768dad4
    chore: Convert create_test_env plugin to attribute based event listening 07d68e2d61
    chore: Convert onlyofficePlugin to attribute based event listening dc615467fb
    chore: Remove constant based events from tracker plugin 16b3f18c32
    Convert projectmilestones to attribute based event listening 39147dd291

    Follow-ups

    User avatar

    All open changes related to that topic were merged, let's closed this artifact. We will open dedicated artifacts for future conversions.


    • Status changed from Under implementation to Closed
    • Connected artifacts
    • Close date set to 2023-03-30