Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #1971384: [META] Convert page callbacks to controllers
For instructions on how to convert a page callback into a controller, see the WSCCI Conversion Guide.
Comment | File | Size | Author |
---|---|---|---|
#15 | shortcut-convert-edit-form-1978964-15.patch | 3.3 KB | sanchiz |
#13 | shortcut-convert-edit-form-1978964-13.patch | 2.82 KB | sanchiz |
#9 | shortcut-convert-edit-form-1978964-9.patch | 2.88 KB | sanchiz |
#7 | shortcut-convert-edit-form-1978964-7.patch | 3.26 KB | sanchiz |
#4 | shortcut-convert-edit-form-1978964-4.patch | 5.84 KB | sanchiz |
Comments
Comment #1
vijaycs85Comment #2
sanchiz CreditAttribution: sanchiz commentedInitial patch
Comment #3
dawehnerYou seem to have forgotten the name file :)
This feels out of scope :)
We should not remove this lines, because that's still needed.
You need an access checker defined for this route to implement the previous access logic.
Comment #4
sanchiz CreditAttribution: sanchiz commentedAdded access checker and other fixes.
Comment #5
dawehnerCouldn't you actually use something like views is doing:
So basically you can explicit tell the system to use an entity form controller and all logic is handled in there. No need for an extra route controller
Comment #6
dealancer CreditAttribution: dealancer commentedLooks like we are adding additional access controller to run following function:
It is called in several places, also it relies on shortcut_current_displayed_set().
Looks like access functions and controllers should be completely re factored. Any ideas how to do it or may be we can do it as a separate issue?
Comment #7
sanchiz CreditAttribution: sanchiz commentedRemove extra route and use default entity logic.
Comment #8
dawehnerYou don't need this additional hook_entity_info anymore.
Comment #9
sanchiz CreditAttribution: sanchiz commentedReally, deleted.
Comment #10
dawehnerManually using the form still works.
Comment #11
alexpottHmmm... it doesn't look like we've properly replaced the shortcut_set_edit_access() function... current function below
Comment #12
alexpottUpdating status appropiately...
Comment #13
sanchiz CreditAttribution: sanchiz commentedBut this logic controller uses to remove. You must use the shortcut_set_edit_access() in method checkAccess() or move shortcut_set_edit_access() in checkAccess()?
This patch use shortcut_set_edit_access() in access controller
Comment #14
alexpottI think we should put the logic in the access controller. I.e. something like this...
Comment #15
sanchiz CreditAttribution: sanchiz commentedThis solution works fine. Fixed.
Comment #16
alexpottComment #17
dawehnerManual testing worked fine.
Comment #18
alexpottCommitted 62eebd6 and pushed to 8.x. Thanks!
Comment #19
andypostFiled follow-up bug fix #1993992: Edit shortcuts toolbar link broken