Problem/Motivation

In core/modules/block_content/block_content.module, the documentation block for block_content_query_entity_reference_alter() includes the line,

Block_content entities that are reusable should by default not be selectable

It should be "not reusable" rather than "reusable". Compare with the change record Added the ability to set Custom Block entities as non-reusable: it says, in part,

Since a Custom Block with the reusable field set to FALSE should not be reused in other parts of the site the queries of EntityReferenceSelection plugins will now automatically be altered to add:

$query->condition("$data_table.reusable", TRUE);

Unless the query satisfies one of these two conditions:
...

The API documentation for block_content_query_entity_reference_alter() is generated from this documentation block, so I am adding the "API Documentation" tag.

Proposed resolution

Insert the word "not" and rewrap the affected line and the next to 80 characters.

Remaining tasks

User interface changes

None, except in the API documentation.

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benjifisher created an issue. See original summary.

rajdeep0826’s picture

Assigned: Unassigned » rajdeep0826
reinchek’s picture

Hi! I applied this correction.
Thanks for segnalation,
Nino.

benjifisher’s picture

Status: Active » Needs review

@rajdeep0826:

When you assign an issue to yourself, please also leave a comment explaining what you plan to do. Since there is already a patch on this issue, you can contribute by reviewing it. From your profile, I see that this could be your first core issue. Thanks for your interest in helping!

@reinchek:

When you add a patch to an issue, you should also set the status to Needs Review (NR). This will trigger the testbot. I will do that for this issue.

reinchek’s picture

@benjifisher:
Next time I'll be more careful! Thanks,

Nino.

benjifisher’s picture

Assigned: rajdeep0826 » Unassigned
Issue summary: View changes
Status: Needs review » Needs work

I guess that @rajdeep0826 has moved on to other things, so I am unassigning this issue.

Nino:

The patch looks correct, but when I try to apply it, I get this:

$ git apply /tmp/3098922-1.patch
/tmp/3098922-1.patch:12: trailing whitespace.
 * Block_content entities that are not reusable should by default not be 
warning: 1 line adds whitespace errors.

Trailing whitespace should almost always be avoided. See Indenting and Whitespace in the Drupal coding standards. I am setting the issue status to NW. Please attach an updated patch and (for practice) an interdiff: Creating an interdiff.

I was reminded of the practical importance of following standards for indentation just last week. One of my coworkers fixed the indentation in composer.json and I had to resolve some merge conflicts. We should never have let the incorrect indentation get committed in the first place!

I am also updating the issue description with a reference to the relevant change record.

shubham.prakash’s picture

Status: Needs work » Needs review
FileSize
1 KB

Added a patch as asked in #6

benjifisher’s picture

Status: Needs review » Needs work

@shubham.prakash:

Thanks for updating the patch. It looks correct.

This issue is tagged for novices, and your profile shows that you have already contributed to many issues, including several core issues.

Since this is a novice issue, I would still like to see an interdiff: not because I need it in this case but because this is a novice issue and I want to give novices some practice in the usual process. Back to NW.

AkashKumar07’s picture

Status: Needs work » Needs review
FileSize
1020 bytes

Added interdiff as per asked. Thanks

AkashKumar07’s picture

FileSize
1020 bytes

Changed the extension .patch to .txt. Thanks.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1 KB

@AkashkumarOSL:

From your profile, I see that you have credit for several issues, but so far none for Drupal core. I hope you continue to contribute!

Since you accidentally uploaded a file with the .patch extension in #9, I am re-uploading the patch from #7. This helps avoid confusion for both humans and the testbot.

Your interdiff looks correct, but you did not follow the naming convention (see the link I gave in #6). The old standard was simply interdiff.txt but the current recommendation is to include the comment numbers of the patches being compared: interdiff_[old_comment_number]-[new_comment_number].txt. In this case, that would be interdiff_3-7.txt. (The patch attached to Comment #3 was misnamed.)

Actually, the documentation page is not entirely consistent on the naming convention. I will update it.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed dfcf19dad1 to 9.0.x and 0f4bc1f190 to 8.9.x and 8df66ec621 to 8.8.x. Thanks!

Backported to 8.8.x as this is a docs fix.

  • alexpott committed dfcf19d on 9.0.x
    Issue #3098922 by AkashkumarOSL, benjifisher, reinchek, shubham.prakash...

  • alexpott committed 0f4bc1f on 8.9.x
    Issue #3098922 by AkashkumarOSL, benjifisher, reinchek, shubham.prakash...

  • alexpott committed 8df66ec on 8.8.x
    Issue #3098922 by AkashkumarOSL, benjifisher, reinchek, shubham.prakash...

Status: Fixed » Closed (fixed)

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