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.
Problem/Motivation
Query Form doesn't work actually.
the Query form use _custom_access: '\Drupal\cmis\Controller\CmisRepositoryController::access'
but the access method don't receive config_id variable.
Steps to reproduce
Proposed resolution
Rework form with use specific configuration.
Comments
Comment #2
liber_tComment #3
liber_tComment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedpermission_callbacks used if config is not defined in GET parameters
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedpatch uploaded for reviewing
Comment #6
GrimreaperComment #7
GrimreaperHello,
Here is my review:
'permission_callbacks' is not a permission. Also the changed code is the code executed as a permission callback.
No need to put that here, instead of inside the if statement.
No commented code.
I think you have not understood what needs to be done in this issue and how access callback works.
What needs to be done is:
Comment #8
d@DD4 CreditAttribution: d@DD4 at Smile commentedNew permission added
Connection filtering on QueryForm
Comment #9
liber_tRework this patch (#8) and upload this
Comment #10
d@DD4 CreditAttribution: d@DD4 at Smile commentedcmis-query-form-not-working-3167758-8.patch must be ignored
New patch available
Comment #11
liber_tRename to "Access the CMIS query page"
Doesn't need this. just rework permission in "cmis.cmis_query_form_callback" route
It's not Drupal Coding standard
Comment #12
d@DD4 CreditAttribution: d@DD4 at Smile commentedNew patch uploaded
cmis-api-query-form-doesnt-work-3167758-9.patch must be ignored
Comment #13
GrimreaperComment #14
GrimreaperHello,
Going into the right direction now!
But you don't take correctly the previous review points into account.
Here is my review:
Please put it above "permission_callbacks".
Access to the CMIS query page
Allow access to the CMIS query page.
You should do Dependency injection, but as you extends formBase, there is already an helper method currentUser()
Coding standards issue.
And what happens if the user has "access all cmis browsers" permission?
Comment #15
d@DD4 CreditAttribution: d@DD4 at Smile commentedCoding standard fixed
Comment #16
GrimreaperHello,
Thanks for the updated patch. Here is my review.
When updating a patch, please rebase or squash your commits into one commit. Otherwise it is hard to review.
Trailing space
Still no dot at the end of the sentence.
This variable does not depend of the foreach so declare it outside of it. And as it is not used elsewhere, you can avoid using a variable.
Comment #17
d@DD4 CreditAttribution: d@DD4 at Smile commentedHi,
Here is the new patch.
Comment #18
GrimreaperHello,
Thanks for the new patch. Code is ok for me now.
I will apply the patch to test it.
Comment #19
GrimreaperTested ok.
Comment #23
GrimreaperMerged on 8.x-2.x, 2 commits because I forgot to take a file in the commit.
And merged on 3.0.x too.