I'm getting three PHP warnings (PHP 5.5) when I try to use the flot module:

Warning: Creating default object from empty value in template_preprocess_flot_graph() (line 87 of /.../flot/flot.module).
Warning: Creating default object from empty value in flotStylePie->__construct() (line 472 of /.../flot/flot.module).
Warning: Creating default object from empty value in flotStylePie->__construct() (line 475 of /.../flot/flot.module).

All are because using the -> operator when an object hasn't already been created. This patch creates the empty objects to remove the warnings.

Comments

hadsie’s picture

Status: Active » Needs review
StatusFileSize
new918 bytes
Joanna_Kisaakye’s picture

StatusFileSize
new1.03 KB

I moved the check for $options->legend outside the if clause so a new object could also be created in the else clause if need be.

Joanna_Kisaakye’s picture

Sorry hadsie, I accidentally hid your file.

Joanna_Kisaakye’s picture

StatusFileSize
new885 bytes

Removed the /nbproject/private/ folder from my last patch.

mbehensky’s picture

StatusFileSize
new2.37 KB

I just installed flot, and got a bunch of the default object warnings when I displayed the flot example page. I applied patch #4, and some of them went away, but there still were quite a few present. I fixed them in what I hope is the correct way, trying to emulate what had been done in the earlier patches. I am a php and drupal novice (although I've been programming professionally for 30 years), so I may have done something wrong, but the flot example now renders properly for me without warnings.

orange-wedge’s picture

I had to add this too:

+ if (!isset($options->legend->position)) {
+ $options->legend->position = 'bottom';
+ }
if (isset($options->legend) && $options->legend->position == 'bottom' && !isset($options->legend->container)) {

nwom’s picture

StatusFileSize
new3.25 KB
new656 bytes

Here is a new patch that includes the change mentioned in #6

beakerboy’s picture

Status: Needs review » Closed (won't fix)
nwom’s picture

Status: Closed (won't fix) » Needs review

Regardless of whether you as a maintainer do not wish to fix this, this is a PHP warning (which is a bug regardless of the severity). Or was closing this issue perhaps a mistake?

If it wasn't a mistake, what in the patch would warrant it not being able to be committed? This would have normally been the correct course of action rather than closing it without even so much as a comment.

beakerboy’s picture

@NWOM

I was given maintainer privs a year ago because I had ported Flot to D8. At that time I posted a message for the existing team to line out how they intended to manage the previous versions. There have literally been no responses in 12 months which tells me they have no intention of supporting older versions so I closed all outstanding issues with the “will not fix” tag. Honestly, my hope was that this would bring at least one person out who would be willing to maintain the D6 or D7 branches. Would you like that responsibility?

nwom’s picture

The D6 drupal core isn't supported anymore, so this totally makes sense for any open D6 issues. D7 is however still currently being supported and modules are still being actively developed for it.

I'd suggest leaving active D7 issues open until D7 is no longer supported, or else it is unfair to those that have contributed. It also makes it easier for those installing the module for the first time to be easily made aware of patches that exist. If an issue is marked as closed, there is no easy way to determine if a patch for their issue exists otherwise.

I personally don't have enough experience to take on maintainership of a module, or else I'd consider it. I just provide patches wherever I can with my limited PHP skills.

beakerboy’s picture

@NWOM

There’s no better way to learn than by doing...and no better way to get something done than by doing it yourself. I have no intention of learning the D7 code so none of the patches are going to be integrated unless someone else steps up. Your 2nd point is somewhat valid, but again, unless we have a D7 maintainer, future bug reports will also just sit in the queue. At this point, a D7 maintainer is more about managing the patches, making sure things are properly reviewed, and then running a git command. The Drupal website has some good guides for how to use git with Drupal, and I’d be more than happy to explain a few things, and I won’t mind if you make some mistakes.

beakerboy’s picture

Status: Needs review » Closed (won't fix)