Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Feb 2014 at 15:43 UTC
Updated:
17 Jan 2015 at 04:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaThis resolves the problem by storing an array in a variable before its passed to array_shift().
Comment #2
damienmckennaComment #3
jaydarnellI don't know much about patches. I've applied a couple over the last few years but I've never written one. When is it safe to say that a patch is good to go? Can I apply this now?
Comment #4
damienmckennaPlease follow the instructions on this page to apply the patch: https://drupal.org/patch/apply
Comment #5
jaydarnellHi Damien,
I actually have git. I've downloaded the patch. Would I simply want to place it in the ctools directory, navigate to that directory and issue the command: git apply -v [patch-name.patch]
Or does it not matter where the patch file is physically located when issuing this command?
Thanks!
Comment #6
damienmckennaIn order to apply the patch you have to 'cd' to the appropriate directory, i.e. the sites directory, then just make sure you provide the proper path to the patch - you can drag 'n drop the patch file to your command prompt / terminal if that makes it easier.
Comment #7
Soos commentedCopperBot: I encountered this bug when I was doing a tutorial today and applied the patch in the video: http://www.youtube.com/watch?v=3stsc2BQj6s in 4:05. Hope that helps!
Comment #8
damienmckennaTag.
Comment #9
czigor commentedThe patch works great and since it is pretty straightforward I mark this as RTBC.
Comment #10
maximpodorov commentedSee also these issues:
#2195211: Warning after update: Missing argument 4 for entity_metadata_taxonomy_access
#2195729: Warning: Missing argument 4 for entity_metadata_taxonomy_access() in entity_metadata_taxonomy_access()
Comment #11
Ravenight commentedThe patch #1 here didn't solve the issue with commerce, however, as @maximpodorov pointed out, the issue #2195211: Warning after update has a patch that did solve this issue when coupled with the patch here.
The issue comes down to this line:
if (function_exists($to_entity_info['access callback']) && !call_user_func($to_entity_info['access callback'], 'view', $loaded_to_entity)) {and is fixed in the other issue with:
if (function_exists($to_entity_info['access callback']) && !call_user_func($to_entity_info['access callback'], 'view', $loaded_to_entity, $account, $to_entity)) {Since the original patch did not solve the problem, I am marking this back to "needs review".
Comment #12
damienmckennaThis issue has nothing to do with Commerce, putting the status back the way it was.
Comment #13
damienmckenna@ravenight: Just to be clear, this issue is limited in scope to a very small bug, it has nothing to do with the bug related to entity_metadata_taxonomy_access, or anything else, it is just this one small bug. The patch above fixes this one problem, it does not need to solve any other problem, so the status of other bugs has no bearing on this patch.
Please do not change the status unless you know of a reason why the patch does not solve the problem described in the issue.
Comment #14
mudderklirren commentedFirst post on Drupal.org :-)
I needed to combine this patch with https://drupal.org/node/2195211, so I have complied both patches, and git diff'et to this file.
It is for 7.x.1-4
Comment #15
joecanti commentedAfter addingthis patch, the strict warning goes, but I get this error:
Notice: Undefined index: access callback in ctools_entity_from_field_context() (line 181 of /home3/alphasa1/public_html/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc).
Any ideas?
Many thanks, Joe
Comment #16
q11q11 commented#14 is not combined completely, warning about 4 parameters still remains, so I`m making another one
Comment #17
maximpodorov commentedWhy do you combine patches for different issues?
Comment #18
mrharolda commentedHiding combined patches to prevent confusion.
Comment #19
drupov commentedPatch from #1 made the strict warning disappear for me.
Comment #20
nikolay shapovalov commentedI've same issue using entity refernce as context in panels.
After pacth apply all warnings disappear.
Comment #21
manuelBS commentedThis patch works for me, too
Comment #22
ergophobe commentedWorks for me
Comment #23
eric_a commented#2195211: Warning after update: Missing argument 4 for entity_metadata_taxonomy_access went in, and the bonus coding standards fix in #1 conflicted with that fix, so I'm pretty sure this needs rerolling now.
Comment #24
eric_a commented1: ctools-n2195471-1.patch queued for re-testing.
Comment #25
eric_a commentedWell, it still passes here because for some reason the d.o. bot is currently testing against the 7.x-1.4 release.
If it keeps doing that then a re-rolled patch against a 7.x-1.x checkout would fail...
Comment #26
czigor commentedComment #27
czigor commented1: ctools-n2195471-1.patch queued for re-testing.
Comment #29
eric_a commentedAh, thanks!
Rerolled patch attached.
Comment #30
eric_a commentedGreen! @czigor, can you take a look and RTBC this once more?
Comment #31
czigor commentedWorks and also looks good and trivial.
Comment #32
damienmckennaThe patch in #1 still applies to the 7.x-1.x branch.
Comment #33
damienmckenna1: ctools-n2195471-1.patch queued for re-testing.
Comment #34
damienmckennaPatch #1 with a new filename.
Comment #36
damienmckennaOh. Wait.
*cleans glasses*
Yes, sorry, Eric_A's patch was correct.
Comment #37
eric_a commentedPatch in #34 passed because it's a renamed #29, not a renamed #1. :-)
And #1 does not apply anymore but it does apply against the current 7.x-1.x-dev build, which is 7.x-1.4+1-dev and needs rebuilding to 7.x-1.4+2-dev to sync with latest 7.x-1.x.
I did a simple reroll, commit credit goes to @DamienMcKenna!
Comment #38
damienmckenna@Eric_A: yeah, I blame not cleaning my glasses for mixing up my patch in #1 with yours in #29. Or something. *whistles innocently* Sorry about that.
Comment #39
bjlewis2 commented#29 works for me too!
Comment #40
japerryThanks! Fixed.
http://drupalcode.org/project/ctools.git/commit/824c312
Comment #42
markbannister commentedOK confused, using 7.x-1.4 and the patch fails.
Comment #43
jaydarnellI made the same mistake markbannister. This patch is not for 7.x-1.4. It is for 7.x-1.x dev (I believe)
When I downloaded the patch and looked at it the line numbers didn't match up with 7.x-1.4. I hope this is fixed with a new release (7.x-1.5) soon. I don't like having such an important module on my life site with a security vulnerability but I can't exactly go with 7.x-1.4 (due to this error message) and I'm not about to put a dev copy on my live site either.
That being said thank you to all the parties involved in working on this module.
Comment #44
mrharolda commentedIt's a strict warning, not a security error or such. And it's also generally advised to not display warnings on a live/production site.
If the patch won't apply (usually line numbers don't have to be exact), just edit the file yourself if you really can't stand the warning.
Comment #45
boobaaAttaching a patch that cleanly applies to 7.x-1.4 – and of course it solves the problem: there's no warning any more.
Comment #46
mudderklirren commentedUpdate to my comment #14
Issue n2195211 address some issues with Entity entity_metadata_user_access and this issue addresses ctools_entity_from_field_context - both patches are for the same file in ctools/plugins/ and when trying to apply both it fails - thats the reason for this patch - overlapping linenumbers.
Comment #47
mudderklirren commentedAnd third update (this IS my first patch on Drupal) - now with a file actually working, combining the overlapping issues from n2195471 and n2195211
Comment #48
damienmckennaIt's recommended that everyone use the -dev release until the next stable release can be rolled out, there's no need to keep rerolling patches.
Comment #49
q11q11 commented@mudderklirren, you made exact patch that i did in #16, but with one syntactis mistake, no space after last "if"
Comment #50
jaydarnellIt was my understanding it is never recommended to use dev copies of a module on a production site DamienMcKenna.
Comment #51
damienmckenna@CopperBot: There's little difference IMHO between using a -dev copy vs applying a bunch of patches, but YMMV. I don't think I've ever launched a Drupal site that didn't have at least a handful of -dev modules.
Comment #52
smira commentedHey @DamienMcKenna, just curious to know a potential timeline for a stable release that will include this fix?
Thank you for all your hard work here!
-Miro
Comment #53
damienmckenna@smiro: As I'm not a comaintainer of CTools I cannot answer that question. Sorry. In the meantime you should be safe running the latest -dev release, I've used it on some production sites without any problems.
Comment #56
jvinci commentedFor the record: #47 worked for me as applied to ctools 7.x-1.4.
Thanks everyone.
Comment #57
juanramonperez commentedI fixed changing this line (ctools 7.x-1.4)
for this ones
Only variables should be passed by reference
http://php.net/manual/es/function.array-shift.php
Comment #58
mrharolda commented@juanramonperez, just use the 1.5 version of Ctools, it has this fix in it.
Comment #59
juanramonperez commented@MrHaroldA sure I will. thanks.