I'm getting this notice error often, also shows up after an update.php process has completed
Notice: Undefined index: flagging in views_handler_field_field->access() (line 127 of /.../drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).
Notice: Undefined index: flagging in views_handler_field_field->access() (line 127 of /.../drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).
Notice: Undefined index: flagging in views_handler_field_field->access() (line 127 of /.../drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).
drupal 7.31 (new update)
php 5.4.28
conditional field-7.x-3.0-alphal1 (new use)
field validation 7.x-2.4
flag 7.x-3.5
optional mail on register (new use)
ctools 7.x-1.4
| Comment | File | Size | Author |
|---|---|---|---|
| #66 | views_handler_field.patch | 481 bytes | alancooney |
| #59 | views-undefined_index_flagging-2331209-59-D7.patch | 672 bytes | digitalfrontiersmedia |
| #19 | 2331209-4-views-7.x-3.x-undefined-index.patch | 665 bytes | nico.knaepen |
| #16 | 2331209-3-views-7.x-3.x-undefined-index.patch | 853 bytes | nico.knaepen |
| #2 | 2331209-2-views-7.x-3.x-undefined-index.patch | 665 bytes | alberto56 |
Comments
Comment #1
operawong commentedComment #2
alberto56 commentedThis error creeps up once in a while: #2031477: Undefined index: users in views_handler_field_field->access() (line 127 of sites/all/modules/views/modules/field/views_handler_f, #2129841: commerce field in a view generates Notices : Undefined index: node in views_handler_field_field->access() (line 127 in /var/www/mysite/sites/all/modules/views/modules/field/views_handler_field_field.inc)..
In my case, it happens when I run automated tests in a module which has, as a dependency, a feature which defines a view which itself requires third-party module. In some cases this results in a missing handler during the installation process, even though after the installation is complete and the cache is cleared, everything works as expected.
See an example in the image enclosed.
Here is a patch which checks if the handler is available before checking for access. If the handler is not available then the access is presumed to be false be no error is thrown.
Comment #3
mrpauldriver commentedAlbert. Please could you tell me against which module your patch should be applied?
Comment #4
alberto56 commented@MrPaulDriver should be against the root of the views module.
Comment #5
mrpauldriver commentedNo file to patch?
---
Comment #6
alberto56 commented@MrPaulDriver, you need to add -p1, like this
You will find more information about patching here.
Cheers,
Albert.
Comment #7
mrpauldriver commentedThank you Albert, please excuse my ignorance.
Comment #8
ismail cherri commentedThank you! You saved me a great headache :)
Comment #9
333martine commented@alberto56: thank you very much for posting the patch solution. It worked :)
Comment #10
ccbearyeh commentedThank you so much, this patch works.
Comment #11
dave kopecekThank you alberto56 !! Patch works in #2. Wow. This had me stumped.
Comment #12
darrellduane commentedThis patch fixed this error for me as well. Let's commit this patch! Thanks Alberto56
Comment #13
darrellduane commented@Dave Kopecek, @ccbearyeh, @333martine, @Ismail Cherri, the next time you download a patch and it fixes something for you, please change the status to Reviewed & tested by the community so that the views maintainers know to included it in the next release of views. This issue has remained in views longer than it needed to and affected others 'cos no one knew that it was fixed by this patch.
Comment #14
pthornhi6 commented+1 - I had this same problem. The patch got rid of the error. But it still seems like something is wrong upstream. Seems like I shouldn't arrive to that function without a handler being available.
Comment #15
colanWe've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.
If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.
We apologize for the trouble, and appreciate your patience.
Comment #16
nico.knaepen commentedRe-uploaded patch and set status to "Needs review".
alberto56,
Your patch works fine on my site. Thnx for patching.
Comment #18
jeromewiley commentedSo, if it failed testing (#17), should I apply it to my site or not?
Comment #19
nico.knaepen commented@jeromewiley,
I've added a new patch. The previous patch path was incorrect. That's the reason why it wouldn't apply.
Comment #20
massiws commentedNotice: Undefined index: users in views_handler_field_field->access() (line 127 of /.../sites/all/modules/contrib/views/modules/field/views_handler_field_field.inc)I get this error message on any page when clearing cache.
Applying patch #2 don't fix the problem.
Comment #21
maxplus commentedHi,
using the patch from #19 solved this issue for me,
Thanks!
Comment #22
scottsawyerpatch in #19 removed the notice for me.
Comment #23
webservant316 commented#19 works for me.
Comment #24
riddhi.addweb commentedComment #25
webservant316 commentedI manually reapplied patch #19 to views 7.x-3.14. Any chance of getting this committed?
Comment #26
nico.knaepen commented@webservant316,
You could help it getting commited by reviewing it and putting the status in "Reviewed & tested by the community". Then it's up to the authors to commit the patch.
Regards,
Nico
Comment #27
webservant316 commentedworks for me.
Comment #28
vinay3a commented@alberto56: Thanks it works for me
Comment #29
betz commentedI can confirm this is working as expected on 3.14
Comment #30
zalak.addweb commentedComment #31
kclarkson commentedI love the Drupal Community!
Fixed my issue on 3.14.
Comment #32
deepakrmklm commentedThis works fine for me.
Comment #33
jprj commentedI've still got the problem (using 3.14). It only pops up when I run update.php. I've not done any real diagnosis - so I need to have a look. Just to clarify - I've not tried deepak_zyxware's patch. Will have a look at it (but it won't be overnight...!)
Comment #34
colan@deepak_zyxware: What's the difference between #19 and #32? Please explain why you're posting a patch on top of an RTBCed one, and/or use interdiffs.
Also, can someone tell me if this is also an issue in D8? If so, we need to create another issue for that. Thanks.
Comment #35
ljgra commentedIf the patch above does not work, try this:
>> this seemed to happen when in /admin/structure/views/view/commerce_cart_summary/edit/default you added commerce line item under FIELDS the customized line item type "whatever it is"
>> go to views /admin/structure/views and look for this: Shopping cart summary
>> hover over the EDIT link in the right side, then on dropdown, click revert
>> click edit (/admin/structure/views/view/commerce_cart_summary/edit/default) and place back the commerce line item "whatever it is"
Comment #36
CmKeen commentedI've tested both patch #19 and #32 and I still have the error.
Any idea on what it could be?
TX
Comment #37
scottsawyerFYI, I just updated views from 3.14 to 3.15, it reverted this patch, error returned. Once I re-applied patch in #19, errors go away.
Comment #38
webservant316 commentedwhat is the hold up on the patch in #19? I am upgrading to views 3.15, but now need to re-patch.
Comment #39
echoz commentedThe patches from #19 + #32 are identical.
Comment #40
damienmckennaComment #41
dave kopecek#19 works for me against 7.x-3.16. Tested & now 24 hour on production site with no errors where errors were occurring regularly pre-patch.
Comment #42
dave kopecekComment #43
kris77 commented#19 works for me too with 7.x-3.15.
Thanks @nico.knaepen
Comment #44
webservant316 commentedwhat is the hold up on the patch in #19? I am upgrading to views 3.16, but now need to re-patch.
Comment #45
colanThanks for #39. Now this is only blocked on my D8 question in #34.
#42: Please do not change the status back to RTBC until the necessary information is provided. Thanks.
Comment #46
colanComment #47
nico.knaepen commentedThere is no difference between #19 and #32.
Comment #48
colan#47: We still need to know if this is an issue in D8. If not, we can commit the above patch to D7. If so, we need to open a separate issue for this in D8 core before the above patch can be committed to D7 to prevent a regression in Drupal 8.
Let's please stop changing the status until such time as someone has figured this out. Thanks!
Comment #49
giupenni commented#19 + Views 7.x-3.16 works fine.
Comment #50
webservant316 commentedwhat is the hold up on the patch in #19? I am upgrading to views 3.17, but now need to re-patch.
Comment #51
mustanggb commented@webservant316 The hold-up is no-one has answered the question: "Is this a D7&D8 bug, or only D7"
Comment #52
webservant316 commentedhmm yes, sorry, I see that now.
Comment #53
SchwebDesign commentedIf it helps, we have only seen this issue in D7. Similar to what @webservant316 mentioned, we patch this each time we update views but have never seen the error yet on D8. I guess the question is... if no one ever sees this on D8, how do we definitively know that it's only a D7 issue? If no one speaks up regarding D8 for long enough, does that suffice?
Comment #54
colanIf you follow the same steps in D8 as in D7 to reproduce, and you don't see the problem, then it's not a problem in D8.
Is that what you're saying?
Comment #55
webservant316 commentedrolling the patch in my views 7.x-3.18 install.
Comment #56
darrenwh commentedThis patch worked for me in D7.
Comment #57
digitalfrontiersmediaI'm returning this back to "Needs Review". This issue queue is for the Views project, of which only D7 is supported. If there is a problem in D8, that should be filed against Drupal Core, component "views module". If there were a regression then it was already introduced when it was integrated into Drupal Core nearly 3 years ago. If it turns out that it's there, then someone can link it as related to this issue. But a solution has been here for over 2 years for D7 users and it's not getting evaluated for release because of an issue that may or may not be present in D8 and that would be posted separately anyway according to the notices in this very issue queue:
Comment #58
webservant316 commentedManually rolled the patch into views 7.x-3.20. No longer cleanly applies.
Comment #59
digitalfrontiersmediaRerolled patch in #19 against views-7.x-3.x-dev.
Comment #60
digitalfrontiersmediaThere are 9 comments here that indicate that the patch in #19 works (now rerolled against current dev in #59). There are 6 more confirming that it works if you consider that the patch in #2 is basically the same patch as in #19 (& #32) rolled against different versions. That's 15 yeas.
There are 4 comments following #19 that indicate a possible issue still remaining: #20, #33, #35, and #36. Of those, only #20 & #36 clearly state that they actually applied the patch and that it did NOT clear up their problem. No follow-up information was pursued on #20 or #36 to ensure their issue is actually due to this particular issue. That's 2 potential nays.
Can someone test the patch in #59 and if it works for them, mark it RTBC (again), and let's get this committed, please?
Comment #61
liamknuj commentedpatch #59 works for me, please commit it to new update
Comment #62
digitalfrontiersmediaMarking as RTBC on behalf of liamknuj.
Please commit. Thank you. :-)
Comment #63
kris77 commentedI just upgraded to the latest version, but I had to reapply the patch in # 19.
It's possible to commit it to new update?
Thanks.
Comment #64
Anonymous (not verified) commentedPatch #19 worked for me on 7.x-3.20
Comment #65
Anonymous (not verified) commentedI had these errors showing up in rules, after adding "Load a list of entity objects from VBO".
Manually added patch #59 to Views 7.x-3.20 and errors are gone. Thanks!
Comment #66
alancooney commentedPatch updated for latest version
Comment #68
digitalfrontiersmediare: #66 -- I don't know what version you rolled your patch against, but it fails to apply, doesn't match where the patch should actually start (at line 127 against the latest dev, 7.x-3.20+12-dev, 2018-12-07, which is what the patch should be rolled against), and patch #59 still applies cleanly against the latest dev (7.x-3.20+12-dev).
The patch in #66 is identical to patch #19 (with exception of the diff header).
Setting this back to RTBC for patch #59.
The solution has been languishing for 2 years (since patch #19, 1 March 2016) bouncing its status around needlessly with confusing patch reposts. Can somebody please commit #59, credit nico.knaepen with the original solution, and put it out of its misery?
Comment #70
dave kopecekSeconding what @DigitalFrontiersMedia said in #68. Just added 7.1 and 7.2 tests to #59 and it passes.
Comment #72
damienmckennaCommitted. Thanks all.