According to the php page for the function count()
http://php.net/manual/en/function.count.php

If var is not an array or an object with implemented Countable
interface, 1 will be returned.

So if $data->content is empty but not null then count($data->content) will 
return 1.
Which is not what we want.

Probably a better approach would be to not use the count() function and
just use is_array() and/or !empty()

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contrib members
https://bugs.launchpad.net/bugs/1191605

Title:
  blocktype/externalfeed/lib.php throws array_chunk errors

Status in Mahara ePortfolio:
  Fix Committed

Bug description:
  Errors thrown:
  [WAR] fc (blocktype/externalfeed/lib.php:79) array_chunk() expects parameter 
1 to be array, string given

  [WAR] fc (blocktype/externalfeed/lib.php:83) Invalid argument supplied
  for foreach()

  Need to make sure the $data->content is not empty and is an array as
  that is what is wanted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1191605/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to