https://cgit.drupalcode.org/node_access_grants/tree/src/NodeAccessGrants...

The $implementations should be initialised with an empty array.

If this module is installed and there are no modules that use it (no implementations), then the 'foreach' will be throwing warnings for each page load.

And if your site has watchdog enabled - the DB fills in quite quickly (5G in 1 hr)

Warning: Invalid argument supplied for foreach() in Drupal\node_access_grants\NodeAccessGrantsCollection->grants() (line 43 of modules/contrib/node_access_grants/src/NodeAccessGrantsCollection.php).

Comments

alex.designworks created an issue. See original summary.

alex.skrypnyk’s picture

Issue summary: View changes
Snehal Brahmbhatt’s picture

Status: Active » Needs review
StatusFileSize
new783 bytes

@alex.designworks, It gives an error because getting $this->implementations null, When no permission set for content. Review the attached patch & let me know if you have any query regarding it.

janehollander’s picture

StatusFileSize
new1.34 KB

The same if statement should be applied to the grants method as well. Here is patch off #3 which will do just that.

  • Upchuk committed af60811 on 8.x-2.x
    Issue #3040218: Warning when no modules using this module
    
upchuk’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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