Using PHP 5.1

Whenever I try to preview a follow-up to an issue I get the error "You have to specify a valid project."

Along with 4 PHP Warnings.

Warning: Attempt to assign property of non-object in /var/www/html/sites/default/modules/project/comment.inc on line 77

Warning: Attempt to assign property of non-object in /var/www/html/sites/default/modules/project/comment.inc on line 78

Warning: Attempt to assign property of non-object in /var/www/html/sites/default/modules/project/comment.inc on line 85

Warning: Attempt to assign property of non-object in /var/www/html/sites/default/modules/project/comment.inc on line 88

Comments

PunkCut25’s picture

sorry shouldve clarified. This is regardless of whether or not I have a valid project selected.

dww’s picture

Assigned: Unassigned » dww

yup, i can reproduce on a test site. that's good. ;) without having looked closely at the code, this should be relatively easy to fix. i'll try to roll a patch in the near future, unless someone else beats me to it.

dww’s picture

Status: Active » Needs review
StatusFileSize
new2.13 KB

can someone else please review/test this?

  1. makes project_comment_validate() just use a reference, to be a little more simple
  2. converts $edit from an array to an object in the case of project_comment_form_add_preview(), so we can always use it as an object
  3. a few minor variables renamed

seems to solve the problem on my php5 test site, and still works on my php4 site. but, it's after 2am here, so i'd like independent verification before i commit it. ;)

thanks,
-derek

michaelfavia’s picture

Roger Dodger. Patch applies cleanly and resolves all warnings for me. Will notify of any further breakage. -mf

Gurpartap Singh’s picture

Status: Needs review » Reviewed & tested by the community

Patch fixes all the above problems. Marking RTBC.

dww’s picture

Status: Reviewed & tested by the community » Fixed

committed to DRUPAL-4-7 and DRUPAL-4-7--2.

Anonymous’s picture

Status: Fixed » Closed (fixed)