Created on 4 July 2025, 2 months ago

Problem/Motivation

This is an MR with a whole range of minor tweaks I noticed while reviewing.

šŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

šŸ‡¬šŸ‡§United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jonathanshaw
  • Merge request !11Resolve #3534223 "Misc fixes" → (Merged) created by jonathanshaw
  • šŸ‡¬šŸ‡§United Kingdom jonathanshaw Stroud, UK

    Most commits are trivial. The DonorAddForm commit contains a substantial rework of things related to ContextOverviewController, DonorAccountForm and related logic. I like where this ended up, something more generic that works with contexts other than the user.

  • šŸ‡¬šŸ‡§United Kingdom jonathanshaw Stroud, UK
  • šŸ‡¬šŸ‡§United Kingdom jonathanshaw Stroud, UK

    Regarding the change from DonorAddForm to DonorAccountForm the basic idea is that when I looked at it I realised that it could be more generic than just the user account scenario. It would work with any type of context entity, once I added the DonorInterface::isCurrentUser() method. A site would need to customise the donor entity class to make it work with non-users, but it could be done in principle. It seemed to me like it was turning into a pretty generic Donor 'add' form.

  • First commit to issue fork.
  • šŸ‡¬šŸ‡§United Kingdom adamps

    The changes in gift_aid_user.routing that I was surprised that they work - well as far as I can see, they don't😃.

    The gift aid tab on the user was missing, which I fixed by correcting the filename to gift_aid_user.links.task.yml. However then it hits a bug with missing parameter context, because the parameter is inherited from the user account, which is user.

    The fix was quite difficult. For the ContextOverviewController::view() method I discovered that I could get passed the whole request. For the access check, the same technique didn't work however I found that I could implement my own access-checking service.

    I've also adjusted the forms as explained in the comments on the MR. The form is now called DonorContextForm, and is used whenever editing/adding a Donor from within a context.

  • šŸ‡¬šŸ‡§United Kingdom jonathanshaw Stroud, UK

    However then it hits a bug with missing parameter context, because the parameter is inherited from the user account, which is user.

    So if I understan right you're saying that this code works for the route:

    gift_aid.user_context:
      path: '/user/{context}/gift-aid'
      options:
        parameters:
          context:
            type: entity:user
    

    but it breaks the links.task because that expects the parameter name to match the base route its inheriting from. Interesting, makes sense.

  • Pipeline finished with Skipped
    about 2 months ago
    #547030
  • šŸ‡¬šŸ‡§United Kingdom adamps

    but it breaks the links.task

    Exactly.

    The tests now pass again, so let's get this in.

  • šŸ‡¬šŸ‡§United Kingdom adamps
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024