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.
Reworked configs schema, moved core functionality to a service class, reworked module's structure
Please review my patch
Comments
Comment #2
id.tarzanych CreditAttribution: id.tarzanych commentedComment #3
id.tarzanych CreditAttribution: id.tarzanych commentedHad to bring back
to make Content Access compatible with ACL.
Comment #4
id.tarzanych CreditAttribution: id.tarzanych commentedRemoved ACL dependency from default Content Access test case
Comment #9
id.tarzanych CreditAttribution: id.tarzanych commentedUpdated AclTestCase
Comment #14
id.tarzanych CreditAttribution: id.tarzanych at Internetdevels commentedOne more attempt...
Comment #15
id.tarzanych CreditAttribution: id.tarzanych at Internetdevels commentedComment #16
LpSolit CreditAttribution: LpSolit as a volunteer commentedThe code looks good, but a migration path should exist for the ~1000 installations already using 8.x-1.x-dev, to move data out of the content_access table into the new format. The patch ignores existing settings, which would be a severe regression. A content_access_update_8101() function implementing hook_update_N() should do it.
Comment #17
Sutharsan CreditAttribution: Sutharsan commented@id.tarzanych thanks a lot for the work to replace the procedural code by a service. There is a lot to gain by using services.
My comments on the patch.
Nitpicking...
Don't use abbreviations in method names. 'Gid' -> 'GrantId'
Don't use abbreviations in method names. 'Op' -> 'Operation'
Typo: not 'proccess' but 'process'
Don't use abbreviations in method names. 'Op' -> 'Operation'
As above use 'getRoleIdsPerNodeOperation' instead of 'getRidsPerNodeOp'
Method descriptions should fit on one line. Additional info to be separated with an empty line.
Description is plural ("... settings.") and method name is singular. This is confusing.
Hmm, on a 'get' method I don't expect defaults to be added. (Without reading the code) this note causes more confusion that it is worth.
Missing 'public'
The is not a clear distinction between getPerNodeSetting and getPerNodeSettings, but the description of with _and_ the different variables suggest differently. I suggest to use a better name for one or both.
I suggest to rename to 'setPerNodeSettings'. That is more consistent with get(PerNode)Settings and setSettings.
Typo: "Removes grants that don't change anything."
Pls
Changes like these are not related to using a service instead of procedural code. Imho they should not be in this patch, it causes noise dring the review process.
Comment #18
Sutharsan CreditAttribution: Sutharsan commentedI don't like the introduction of a custom table to store settings. Further it extends the scope of this issue too much. Introducing a service is already pretty big, but only technically. Now we are about to to start a discusion on the storage of settings (configuration). I suggest to remove it from the patch and make a follow-up. That way we can the discuss that separately and keep the 'service' moving.
Comment #19
gisleUnassigning to allow others to finalize this.
Comment #20
gisleThis should go into the version compatible with Drupal 10.