hi,
had this patch applied for a while fixes this small error, applies to 2.x branch too (with offset).

CommentFileSizeAuthor
corner-small-fixes.patch1.53 KBeMPee584

Comments

kirie’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » kirie
Status: Needs review » Fixed

Thanks! Patch committed to HEAD (with minor adjustments).

eMPee584’s picture

Title: undefined object property $corner->cid » iundefined object property $corner->cid
Status: Fixed » Postponed (maintainer needs more info)

the minor adjustment

  $default = new stdClass();
  $default->cid = 0;
  $default->name = '';
  $default->image = '';
  $default->image_title = '';
  $default->image_uri = '';
  $default->status = 1;
  $default->languages = '';
  $default->roles = '';
  $default->visibility = 0;
  $default->pages = '';
  $default->location = 0;
  $default->position = 0;
  return (object) $default;

is actually pretty dull because the object casting transforms the array into an object all by itself. So basically you just converted several lines of working code into ugly working code ;-P

kirie’s picture

Yeah, I should have removed that object casting in the return - I'll fix it tomorrow, thanks for telling.

eMPee584’s picture

your motivation for that is still unclear to me. Huh?

kirie’s picture

There is no need to cast the object into an object - as its already an object :)

eMPee584’s picture

Title: iundefined object property $corner->cid » undefined object property $corner->cid

yeah sure but creating an array and casting to an object is allowed and plain shorter!
ahh whatever as long as it don't throw errors.

kirie’s picture

I understand what you are saying, however, it's probably better to use an object there, as people glancing at the code immediately understands that we're dealing with an object (could be easy to miss the object casting in the return) - shorter isn't necessarily better, especially if the price is less readability, imho :)

kirie’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.