This module is a simple plugin to enable boolean (checkbox) fields on a node to be used as a condition to determine whether or not a block (or other entity using conditions for visibility) should be visible.

Project link

https://www.drupal.org/project/node_boolean

Git instructions

git clone --branch 8.x-1.x https://git.drupal.org/project/node_boolean.git

Similar projects

Entity Field Condition
The entity field condition module is really good as it allows the use of any field type, but with the limitation of only allowing a single field to be evaluated. This contrasts to the Node Boolean module in its only currently being applicable to boolean fields but being able to evaluate against multiple boolean fields and comparing them in an either all or any combination.

Demo

https://simplytest.me/project/node_boolean

CommentFileSizeAuthor
#6 Screen Shot 2018-09-05 at 22.48.10.png96.81 KBolegel

Comments

andywhale created an issue. See original summary.

andy_w’s picture

kyberman’s picture

Status: Needs review » Needs work

Review of the 8.x-1.x branch (commit 027862f):

  • PAReview result is almost clean, only writing of test is recommended: https://pareview.sh/pareview/https-git.drupal.org-project-node_boolean.git.
  • Git repository and README is nice and clean.
  • Package inside node_boolean.info.yml needs to be changed - "Fields" is probably the best one, or "Other" if not.
  • Instead of "if (!$this->configuration['boolean'])" I would use "empty($this->configuration['boolean'])".
  • Use class specific "$this->t(" inside "summary()".
  • Local variables inside functions shouldn't be camelCase ("$fieldValue").
  • Dependency injection should be used instead of "\Drupal::service()" - you can check e.g. "core/modules/language/src/Plugin/Condition/Language.php" as an example.
  • I need to say I like this module idea a lot. Nice work!
avpaderno’s picture

Issue summary: View changes
andy_w’s picture

Status: Needs work » Needs review

Coding standards changes made in line with kyberman's review. Thanks for reviewing :-) and for the feedback

olegel’s picture

Status: Needs review » Needs work
StatusFileSize
new96.81 KB

Automated review:
No problems found with coding standards.

Manual review:
Module breaks with fatal error after enabling.
Screenshot attached. The reason is missing use statement of ContainerInterface.

'use Symfony\Component\DependencyInjection\ContainerInterface;' should be added to NodeBoolean.php file.

Also, could you check README.md - it almost fits Drupal standards, just few additional notes (Like headings should be underlined with ===/--- to the length of the heading)
Please check https://www.drupal.org/docs/develop/documenting-your-project/readme-temp...

andy_w’s picture

Status: Needs work » Needs review

Oh dear the result of sliding in that last change. I've now updated in the 8.x-1.x branch and manually tested, all working as expected.

Also updated the README.md to include the conventions from the README.txt (including double spacing ahead of headings and the ---/=== format).

olegel’s picture

Status: Needs review » Reviewed & tested by the community

Issues are fixed and module seems to work.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!

I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

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