- Issue 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
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 parametercontext
, because the parameter is inherited from the user account, which isuser
.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.
-
adamps ā
committed 0da6a8c8 on 1.x authored by
jonathanshaw ā
Issue #3534223 by jonathanshaw, adamps: Misc fixes
-
adamps ā
committed 0da6a8c8 on 1.x authored by
jonathanshaw ā
- š¬š§United Kingdom adamps
but it breaks the links.task
Exactly.
The tests now pass again, so let's get this in.
Automatically closed - issue fixed for 2 weeks with no activity.