Closed (fixed)
Project:
Frequently Asked Questions
Version:
8.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2016 at 22:02 UTC
Updated:
29 Nov 2017 at 11:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
livido commentedon line #32 , you must change it to:
function faq_node_access(\Drupal\node\NodeInterface $node, $op, $account) {
Comment #3
sumitmadan commentedHi lilbebel,
I am not able to reproduce the error. Would you please provide me the steps to reproduce it?
Please make sure you are using the latest code of 8.x-1.x version.
Comment #4
lilbebel commented@sumitmadan
Thank you for following up and sorry for my slow reply. I ended up having to do some major reworking of the site including moving it to a different database so now it isn't throwing the error anymore. I was working on SQLite locally and had to move it to MySQL so perhaps that was the issue. At this point though, I don't have access to the original issue. Sorry for the inconvenience.
M
Comment #5
jurgenhaasI'm seeing this warning too, but only on the development site with the settings such that warnings get displayed, which by default is turned off in Drupal. You get this when you enable the settings.local.php and in particular the following line is making sure you get such output:
The full output of the error is this:
Comment #6
jurgenhaasThe comment from @livido above is quite correct and attached is a patch that does that for you. Just verify your function signature with the hook definition and you'll see that you have one argument to many.
Comment #8
jurgenhaasNot sure why the test failed, can somebody help please?
Comment #10
dom. commentedfunction faq_node_access(\Drupal\node\NodeInterface $node, $op, \Drupal\Core\Session\AccountInterface $account) {
Patch #6 works nice.
As per documentation though (https://api.drupal.org/api/drupal/core!modules!node!node.api.php/functio...) I would just enforce the type check on third arguments.
Comment #12
BD3 commentedPatch in #10 removes the warning for me. Not sure why it failed testing again though.
Comment #13
ruslan piskarovPatch in #10 removes the warning for me.
Comment #14
fsayoub commentedPatch #10 removed the warning for me.
Comment #15
gg24 commentedHi,
I am able to reproduce the issue and patch works as expected. This can be marked as fixed.
Thanks!
Comment #16
ruslan piskarov@gg24, the patch should be applied and committed before. Will wait te reply from @stella.
Comment #18
sumitmadan commented