Throwing it out there
Noticed i was Using latest PHP7 :
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context has a deprecated constructor in require_once() (line 127 of sites/all/modules/contrib/ctools/ctools.module).
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context_required has a deprecated constructor in require_once() (line 127 of sites/all/modules/contrib/ctools/ctools.module).
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context_optional has a deprecated constructor in require_once() (line 127 of sites/all/modules/contrib/ctools/ctools.module).
Comments
Comment #2
joco_sp commentedI also have this problem when upgrading to PHP7
Comment #3
jackbravo commentedThis is a duplicate of #2528736: Deprecating PHP4 style constructors which has already been fixed =). Next release will probably contain the fix.
Comment #4
deepak_thorat commentedDeprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context has a deprecated constructor in require_once() (line 127 of E:\xampp\htdocs\drupalapitest\sites\all\modules\ctools\ctools.module).
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context_required has a deprecated constructor in require_once() (line 127 of E:\xampp\htdocs\drupalapitest\sites\all\modules\ctools\ctools.module).
Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; ctools_context_optional has a deprecated constructor in require_once() (line 127 of E:\xampp\htdocs\drupalapitest\sites\all\modules\ctools\ctools.module).
I am getting this error in php 7 version . How i can solved to this issue any solution plz suggest to me
Many thanks...
Comment #5
mozh92 commentedjackbravo, I find classes in cTools includes/context.inc
and change line 45:
-function ctools_context($type = 'none', $data = NULL) {
+function __construct($type = 'none', $data = NULL) {
line 122
-function ctools_context_required($title) {
+function __construct($title) {
line 207
-function ctools_context_optional() {
+function __construct() {
and it helped me!
Comment #6
rgnyldz commented#5 helped me too
Comment #7
frank hh-germany commentedThe latest dev from 19.02.2016 fix the problem
Comment #8
frank hh-germany commented#5
changing line 207
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'ctools_context_optional' does not have a method 'ctools_context_required' in ctools_context_optional->__construct() (line 209 of /profiles/commerce_kickstart/modules/contrib/ctools/includes/context.inc).
Copy the context.inc from the latest dev over the old context.inc fix the problem.
Comment #9
fizk commentedComment #10
vijayan08 commentedI find classes in cTools includes/context.inc
and change line 45:
-function ctools_context($type = 'none', $data = NULL) {
+function __construct($type = 'none', $data = NULL) {
line 122
-function ctools_context_required($title) {
+function __construct($title) {
line 207
-function ctools_context_optional() {
+function __construct() {
views/includes/handlers.inc
line 761
-function views_many_to_one_helper(&$handler) {
+function __construct(&$handler) {
issue resolved for me
Comment #11
joelpittet@vijayan.nat this was resolved in newer versions of ctools.