Download & Extend

Strict warning creating default object.

Project:Constant Contact
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:justphp
Status:closed (fixed)

Issue Summary

Getting this error on a number of pages on my dev environment, where we develop with strict warnings on (you should too).

Strict warning: Creating default object from empty value in cc->get_lists() (line 386 of [...]/constant_contact/class.cc.php).

Not entirely sure what the issue is, but the code in question is this line:

<?php
function get_lists($action = 'lists', $exclude = 3) {
   
//...
   
$this->list_meta_data->first_page = $this->get_id_from_link($xml['feed']['link']['2_attr']['href']);
   
//...
}
?>

Comments

#1

That error suggests that the $this->list_meta_data object doesn't exist and is automatically created as a StdClass instance.

#2

Status:active» closed (works as designed)

Not an issue.
list_meta_data is defined before being used on line 386 but it's not created as an object which is why we get this error. It's meant to be like this so you can determine if no other pages exist.

#3

Assigned to:Anonymous» justphp

#4

Status:closed (works as designed)» active

This is a bug, not a feature.

#5

Status:active» closed (works as designed)

With all due respect, you don't know WTF your talking about.
The PHP strict warning is only produced for informational purposes, production environments will not display these errors, it does not affect the operation or functionality of the module so therefore how can it be a bug?

#6

Might be a good idea to have a look at http://drupal.org/dcoc

The second half of your response is fine and grounded in a technical argument, but there is absolutely no reason to make this personal.

#7

Status:closed (works as designed)» needs work

That was not my intention and apologise to Damien if it seemed that way, long week :)
I'll keep it in the issue queue but do have bigger things to deal with first so wont be anytime soon this is sorted.

#8

Priority:normal» minor

#9

@justphp: Thanks for the apology, I've had those weeks too but do try to keep your hat on :)

I understand the technical reasonings behind what's going on, and agree that marking this "minor" and leaving it open is the best way to go until, James, myself or someone else can do a patch.

#10

Status:needs work» closed (fixed)

I've added a fix for this. Look out for it in the next release (later today).

nobody click here