> 'description' => 'The realm in which the user must possess the grant ID. Each node access node can define one or more realms.',

Surely this should say 'each node access *module'?

Compare with the docs in node.api.php:

 * A node access module may implement as many realms as necessary to properly
 * define the access privileges for the nodes. Note that the system makes no
 * distinction between published and unpublished nodes. It is the module's
 * responsibility to provide appropriate realms to limit access to unpublished
 * content.

Comments

joachim created an issue. See original summary.

abarrio’s picture

Assigned: Unassigned » abarrio

I'm going to change it.

abarrio’s picture

Assigned: abarrio » Unassigned
Status: Active » Needs review
StatusFileSize
new651 bytes

I have changed description to: "The realm in which the user must possess the grant ID. Each node access from module can define one or more realms."

renatog’s picture

StatusFileSize
new16.69 KB

Hi guys, how are you?

Thank you very much @abarrio.

Works Good.

+RTBC

Good Work and Good Week.

Regards

renatog’s picture

Status: Needs review » Reviewed & tested by the community
renatog’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/node/node.install
@@ -74,7 +74,7 @@ function node_schema() {
+        'description' => 'The realm in which the user must possess the grant ID. Each node access from module can define one or more realms.',

I think this should be Node access modules can define one or more realms.

Note this text is exactly the same in Drupal 7 and Drupal 6...

alexpott’s picture

In fact it's probably better to have something like: Modules can define one or more realms in hook_node_grants(). otherwise someone has to work out what a node access module is.

joachim’s picture

+1 to wording in #8.

jacobsanford’s picture

Status: Needs work » Needs review
StatusFileSize
new652 bytes
new659 bytes

Enclosed is a patch changing the wording as outlined in #8.

valthebald’s picture

Wouldn't it be more clear to say
"Modules can define one or more realms by implementing hook_node_grants()."?
Or it's already clear enough?

jacobsanford’s picture

@valthebald IMHO #11 is certainly an improvement

faline’s picture

Change the text to the suggestion on the #11

joachim’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to go!

renatog’s picture

Looks good for me.

Thanks people.

+RTBC

abarrio’s picture

It is better explained than other patchs for me.

Thanks @faline!!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I've updated the issue credit. I credited myself and @valthebald for making suggestions that altered the final patch. I credited @joachim for discovering and creating the issue. @RenatoG thank you reviewing the patch. Providing a screenshot of the wording was not necessary to review the issue. The actual wording was what needed review.

I think we should add an update function to update the table comment on existing sites too. Given the fact that this description is not API I don;'t think we need an update path test BUT it is important that people can compare the actual schema to a module's computed schema and this patch breaks that at the moment.

c.nish2k3’s picture

Status: Needs work » Needs review
StatusFileSize
new1.26 KB

Patch with update function.

th_tushar’s picture

Added the proper comments to functions.

Status: Needs review » Needs work
alexpott’s picture

Thanks for working on the update function.

  1. +++ b/core/modules/node/node.install
    @@ -155,6 +155,8 @@ function node_uninstall() {
     /**
    + * Implements hook_update_N().
    + *
    
    @@ -177,6 +179,8 @@ function node_update_8001() {
     /**
    + * Implements hook_update_N().
    + *
    
    @@ -193,6 +197,8 @@ function node_update_8002() {
     /**
    + * Implements hook_update_N().
    + *
    
    @@ -222,6 +228,8 @@ function node_update_8003() {
     /**
    + * Implements hook_update_N().
    + *
    
    @@ -236,6 +244,8 @@ function node_update_8300() {
     /**
    + * Implements hook_update_N().
    + *
    
    @@ -248,6 +258,8 @@ function node_update_8301() {
     /**
    + * Implements hook_update_N().
    + *
    

    @th_tushar that change is not in scope for this patch. See https://www.drupal.org/core/scope for guidelines and examples for Drupal core issue scope.
    And not only is this not in scope it is actually wrong because the update system uses the first line of the method documentation to tell a user what updates are being done.

  2. +++ b/core/modules/node/node.install
    @@ -246,3 +246,16 @@ function node_update_8301() {
    +/**
    + * Change {node_access}.realm description.
    + */
    

    As the is used to tell users what's happening we should probably not include {node_access} like this.

    How about
    Fix realm column description on the node_access table

  3. +++ b/core/modules/node/node.install
    @@ -246,3 +246,16 @@ function node_update_8301() {
    +  Database::getConnection()->schema()->changeField('node_access', 'realm', 'realm', [
    +    'description' => 'The realm in which the user must possess the grant ID. Modules can define one or more realms by implementing hook_node_grants().',
    +    'type' => 'varchar_ascii',
    +    'length' => 255,
    +    'not null' => TRUE,
    +    'default' => '',
    +  ]);
    

    Instead of settings the entire schema here we should get the current schema for the column and just update the description. This means that if anyone has done anything interesting we won't unnecessarily break stuff. You'll need to use drupal_get_module_schema('node', 'node_access'); to get the current schema.

  4. +++ b/core/modules/node/node.install
    @@ -246,3 +246,16 @@ function node_update_8301() {
    +}
    \ No newline at end of file
    

    Missing new line at end of file.

ada hernandez’s picture

Assigned: Unassigned » ada hernandez

working on that

ada hernandez’s picture

Status: Needs work » Needs review
StatusFileSize
new1.26 KB
new2.05 KB

changing the last patch according #21

ada hernandez’s picture

Assigned: ada hernandez » Unassigned
c.nish2k3’s picture

Status: Needs review » Reviewed & tested by the community

Tested the patch and looks good. Marking this as RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 23: error_in_schema_field-2863727-23.patch, failed testing.

imadalin’s picture

Status: Needs work » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1058cb9 and pushed to 8.4.x. Thanks!

@th_tushar thank you for submitting a patch I explained in #21.1 the changes you made were out-of-scope and incorrect. If you had instead reviewed the worked of @c.nish2k3 in #18 and asked whether or not this was necessary and confirmed the patch worked and reviewed the docs it was adding you would be credited on this issue.

#17 explains other crediting decisions.

I've tested the update function myself - work great.

  • alexpott committed 1058cb9 on 8.4.x
    Issue #2863727 by Adita, JacobSanford, faline, abarrio, c.nish2k3,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.